-
Notifications
You must be signed in to change notification settings - Fork 363
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
Bug: Pending inbound jobs counter is not set to proper value after connection's SerialExecutor shut down #2065
Comments
|
Nice catch. An alternative idea would be additional pending-in/out counter per connection. WDYT? |
|
I was also considering a similar solution but I find it more difficult to inject into the codebase (and I didn't want to introduce any significant changes). If you think a solution with counters per connection is better and more flexible, I can implement it tomorrow. |
|
I guess, it requires some changes to "add to queue and count or reject and don't count" in an atomic way. That may require something in
If checked your PR and it's not bad. But give me the time tomorrow to consider an alternative solution/implementation. |
Ensure, that jobs removed on shutdown, are considered. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Ensure, that jobs removed on shutdown, are considered. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
|
FMPOV, the |
|
I went through your PR and I like it, nice approach! |
|
OK, I will polish it and add some unit-tests. |
Ensure, that jobs removed on shutdown, are considered. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Ensure, that jobs removed on shutdown, are considered. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Ensure, that jobs removed on shutdown, are considered. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Ensure, that jobs removed on shutdown, are considered. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Ensure, that jobs removed on shutdown, are considered. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Ensure, that jobs removed on shutdown, are considered. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Run pending jobs on connection shutdown to align the counters. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
|
Working on unit tests to ensure the proper function, I found, that the jobs are not only handed over to the SerialExecutor. There was also an issue left with the head of the jobs of the SerialExecutor, which has already been removed from the queue there, but it was not safe that these jobs are processed proper. I replaced therefore the approach by one, which ensures, that the pending jobs are called on connection shutdown and the actual executed functions are blocked. With that, only the "onDequeueing" is executed. I've tested that approach and will continue to do some load-tests tomorrow. |
Run pending jobs on connection shutdown to align the counters. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Run pending jobs on connection shutdown to align the counters. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Run pending jobs on connection shutdown to align the counters. Fixes issue eclipse-californium#2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
|
The I consider to schedule a 2.7.4 release for Wednesday 21.9. and a 3.7.0 for Thursday 22.9. |
|
I'm currently checking the solution in action, so I'm going to give you feedback later today. |
|
Everything looks fine to me. If you are okay with releasing it this week, it would be great to see it. Thank you very much for your engagement! |
|
Thanks for reporting this nasty bug. If nobody else raises an other opinion, I will do the releases as scheduled. |
Run pending jobs on connection shutdown to align the counters. Fixes issue #2065 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
|
Fixed with PR #2068. Contained in minor release 3.7.0. Please close this bug, after confirming that it "works for you". |
|
What's the impact of using PSK(Pre-shared key) during a handshake from the view server side? |
|
Until now, I didn't found such a vulnerability for PSK on the server side. |
|
Appreciate your comments, we are working on the impact and will plan the upgrade accordingly |
Version info
The issue was faced while using Scandium in version 3.6.0 as a DTLS Server.
Failing scenario with the root cause
During a handshake, the server sends a CertificateRequest, and the client responds with a datagram that contains 4 records, starting with an invalid Certificate record (it contains no certificate).
DTLSConnector puts a new job on the connection's serial executor for every record, decrementing
pendingInboundJobsCountdown. Job scheduled for Certificate record throwsHandshakeExceptioncausing connection's serial executor to shut down, therefore counter is decremented 4 times and incremented only once (incrementing happens at the end of scheduled runnables that couldn't be executed).Fix
I have a piece of code that seems to fix this problem and I'm going to issue a PR shortly.
The text was updated successfully, but these errors were encountered: