-
Notifications
You must be signed in to change notification settings - Fork 30
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
Pushoff keep alive on ack received #314
Conversation
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.
The write timestamp can't be shared/singleton.
If I send 5 publishes at times 1, 2, 3, 4, 5. And then an ack comes back for the first one, the push out needs to be based on the first one's write stamp (1).
I dont think it matters, we only need to push off based on the "last" write time since that's when our "last transmission" happened. |
It absolutely matters. If the connect is dropped at time 1.5 then the ping cannot be pushed out farther than that. Connection drops aren't instantaneous. What we're trying to express is the following: "I know the connection was valid at time T because the request I sent at time T received a response from the server." Edit: Adding the followup discussion for completeness/documentation: Consider this situation |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #314 +/- ##
==========================================
- Coverage 82.22% 82.20% -0.02%
==========================================
Files 20 20
Lines 8670 8678 +8
==========================================
+ Hits 7129 7134 +5
- Misses 1541 1544 +3
☔ View full report in Codecov by Sentry. |
tests/v3/connection_state_test.c
Outdated
@@ -3366,8 +3366,8 @@ AWS_TEST_CASE_FIXTURE( | |||
&test_data) | |||
|
|||
/** | |||
* Makes a CONNECT, with 1 second keep alive ping interval, send a publish roughly every second, and then ensure NO | |||
* pings were sent | |||
* Makes a CONNECT, with 1 second keep alive ping interval, send a different operation every second, and then ensure NO |
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.
If this comment is accurate then I feel like this test is likely overly sensitive to timing conditions and containerization.
tests/v3/connection_state_test.c
Outdated
/** | ||
* Makes a CONNECT, with 1 second keep alive ping interval, disable the server auto ack so that we never received ack | ||
* back. Send a qos1 publish roughly every second for 4 seconds. As we never received the ACK, we should send a total of | ||
* 4 ping |
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.
This is alarming. Given a keep aliveof 1 second and a ping timeout of 100ms we should be seeing multiple disconnections which are going to disrupt the logical simplicity of the test.
tests/v3/connection_state_test.c
Outdated
* We would like to wait for a total of ~4.5 seconds to account for slight drift/jitter. | ||
* We have been waiting for 0.8*4=3.2 sec. Wait for another 1 sec here. | ||
*/ | ||
aws_thread_current_sleep(1000000000); |
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.
I don't see any asserts in this test actually checking anything meaningful.
Updated the unit tests. |
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.
Fix comment and ship
tests/v3/connection_state_test.c
Outdated
|
||
// Make sure we publish for 4 seconds; | ||
while (elapsed_time < test_duration) { | ||
/* Publish qos1*/ |
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.
qos0
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.