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

Fixed broker side qos2 exactly once logic. #874

Merged
merged 1 commit into from
Oct 2, 2021
Merged

Conversation

redboltz
Copy link
Owner

@redboltz redboltz commented Oct 2, 2021

endpoint has qos2 duplicated transfer avoiding mechanism.
It is implemented by qos2_publish_handled_.

endpoint works for both client and broker.

However broker (server) is different from the client.
Client can reconnect usign the same endpoint instance as the previous
connection. But the broker can't.
It is because accepting mechanism. On accept, the server needs to create
the new endpoint.

So the broker had an original qos2 duplicated transfer avoiding
mechanism.
It is implemented by qos2_publish_processed_.

But the implementation is a little redundant.
So I introduced get and restore functionality for
qos2_publish_handled_.
It was #873 but it had bug. qos2_publish_processed_ was mixed.
This PR completely removed qos2_publish_processed_ related code from
the broker and added correct implementation for qos2_publish_handled_.

endpoint has qos2 duplicated transfer avoiding mechanism.
It is implemented by `qos2_publish_handled_`.

endpoint works for both client and broker.

However broker (server) is different from the client.
Client can reconnect usign the same endpoint instance as the previous
connection. But the broker can't.
It is because accepting mechanism. On accept, the server needs to create
the new endpoint.

So the broker had an original qos2 duplicated transfer avoiding
mechanism.
It is implemented by `qos2_publish_processed_`.

But the implementation is a little redundant.
So I introduced get and restore functionality for
`qos2_publish_handled_`.
It was #873 but it had bug. `qos2_publish_processed_` was mixed.
This PR completely removed `qos2_publish_processed_` related code from
the broker and added correct implementation for `qos2_publish_handled_`.
@codecov
Copy link

codecov bot commented Oct 2, 2021

Codecov Report

Merging #874 (da08be9) into master (5e1d6b1) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #874      +/-   ##
==========================================
- Coverage   83.56%   83.52%   -0.05%     
==========================================
  Files          62       62              
  Lines        9762     9740      -22     
==========================================
- Hits         8158     8135      -23     
- Misses       1604     1605       +1     

@redboltz redboltz merged commit c24cb62 into master Oct 2, 2021
@redboltz redboltz deleted the fix_qos2_handle_logic branch October 2, 2021 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant