tcp conn pool: fix wrong connection pool deletion#37944
tcp conn pool: fix wrong connection pool deletion#37944zmiklank wants to merge 3 commits intoenvoyproxy:mainfrom
Conversation
fixes envoyproxy#37679 Co-authored-by: Marko Lukša <mluksa@redhat.com> Signed-off-by: Zuzana Miklankova <zmiklank@redhat.com>
|
As a drive by during triage: I think this PR warrants a unit test. Also, in the event this occurs, I think the |
|
@zuercher Thanks. I will work on that. |
ggreenway
left a comment
There was a problem hiding this comment.
In addition to adding a test, please add comments describing what is happening (basically the same content as the analysis in the linked issue).
/wait
Signed-off-by: Zuzana Miklankova <zmiklank@redhat.com>
Signed-off-by: Zuzana Miklankova <zmiklank@redhat.com>
|
Hello, I added a test and explanatory comment to the code. This comment also explains why in my opinion |
|
The tests that failed in CI seem to be unrelated to this PR. |
ggreenway
left a comment
There was a problem hiding this comment.
Thanks for working on a test, but this test will pass with or without the functional change in this PR. Can you make the test so that it would fail without your change?
/wait
| } | ||
|
|
||
| TEST_P(ClusterManagerLifecycleTest, ConnPoolsCorrectDeleted) { | ||
| TestScopedRuntime scoped_runtime; |
|
Thank you for looking at the test @ggreenway. The problem is that we cannot easily The conditions for the issue are described in #37944 in detail. To trigger the Because this issue is a race condition, timing is important to create a test |
|
In the unit test you wrote, there are no other threads, and all actions happen in a deterministic order, so you should be able to write the test so that it will fail without your fix. I think you just need to make all the events that you wrote in your diagnosis of the issue happen in the described order. |
|
Thanks. |
|
Indeed, it is a duplicate, closing. |
Commit Message: Fixes an issue when active tcp conn pool is incorrectly deleted: After an empty tcp conn pool is added to the deferred deletion list the connection pool is removed from the pool map. Then, if new conn pool for the same host with the same hash_key is created before the deferred deletion is cleared it will be incorrectly deleted, because
tcpConnPoolIsIdleerases the pool based on its hash_key. See detailed description in #37679.Additional Description: N/A
Risk Level: Low
Testing: unit
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Fixes #37679