-
Notifications
You must be signed in to change notification settings - Fork 19
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
Drop jobs from Offline downstairs. #1157
Conversation
If we receive a job ACK from an offline downstairs, and that job has already been moved back to New, then discard it as we know the replay will resend it when the downstairs comes back.
I'm surprised that this isn't fixed by #1131: once the downstairs IO task stops, I would expect that we would have mismatches between Looking into the code, I think the real issue is a race condition in I think the correct fix is to fix |
@@ -195,6 +195,9 @@ pub(crate) struct DownstairsClient { | |||
|
|||
/// State for startup negotiation | |||
negotiation_state: NegotiationState, | |||
|
|||
/// Session ID for a clients connection to a downstairs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Session ID for a clients connection to a downstairs. | |
/// Session ID for a clients connection to a downstairs. | |
/// | |
/// This value is incremented whenever we restart the client IO task. |
This looks much better, thanks! My one remaining thought is wondering whether we should define a |
I've done that in the last commit. I think this should be ready to go now. |
upstairs/src/client.rs
Outdated
@@ -2197,7 +2215,7 @@ impl DownstairsClient { | |||
/// different connections to the same Downstairs. | |||
pub(crate) fn get_connection_id(&self) -> Option<u64> { | |||
if self.client_task.client_stop_tx.is_some() { | |||
Some(self.connection_id as u64) | |||
Some(self.connection_id.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be so pedantic, but now that you've added the new type, we should actually use it – this function should be changed to return an Option<ConnectionId>
, and then fix all of the compiler errors and we should be good :)
If we receive a job ACK from an offline downstairs, and that job has already been moved
back to New, then discard it as we know the replay will resend it when the downstairs
comes back.
This is to fix #1155