Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bogus disconnected check #3402

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cpp/src/DataStorm/SessionI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,16 +606,16 @@ SessionI::disconnected(const ConnectionPtr& connection, exception_ptr ex)
// Ignore already destroyed.
return false;
}
else if (connection && _connection != connection)
{
// Ignore the session has already reconnected using a new connection.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is incorrect to check this before verifying if the session is disconnected.

If _session is nullptr because the session is disconnected, we can still receive a disconnected request on a new connection from a failing recovery attempt. In other words, this connection comparison does not ensure that the session has reconnected.

return false;
}
else if (!_session)
{
// A recovery attempt was in progress and failed. Return true to let the caller retry.
return true;
}
else if (connection && _connection != connection)
{
// Ignore the session has already reconnected using a new connection.
return false;
}

if (_traceLevels->session > 0)
{
Expand Down
Loading