Skip to content

Commit 277e8e8

Browse files
committed
del useless code
1 parent 0370bac commit 277e8e8

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

lib/ConsumerImpl.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,13 +1819,9 @@ void ConsumerImpl::seekAsyncInternal(long requestId, const SharedBuffer& seek, c
18191819
if (result == ResultOk) {
18201820
LockGuard lock(mutex_);
18211821
if (getCnx().expired() || reconnectionPending_) {
1822-
// It's during reconnection, complete the seek future after connection is established.
1823-
// Clear local state now so hasMessageAvailable() does not see stale prefetched messages.
1824-
ackGroupingTrackerPtr_->flushAndClean();
1825-
incomingMessages_.clear();
1826-
if (lastSeekArg_.has_value() && std::holds_alternative<MessageId>(lastSeekArg_.value())) {
1827-
startMessageId_ = std::get<MessageId>(lastSeekArg_.value());
1828-
}
1822+
// Reconnection path: delay the seek callback until connectionOpened. clearReceiveQueue()
1823+
// and handleCreateConsumer() (which clears incomingMessages_ under the lock) run before
1824+
// the seek callback is invoked, so hasMessageAvailable() after seek sees cleared state.
18291825
seekStatus_ = SeekStatus::COMPLETED;
18301826
LOG_INFO(getName() << "Delay the seek future until the reconnection is done");
18311827
} else {

0 commit comments

Comments
 (0)