[SERVER-61529] Ldap tests should wait for connection reaper to be terminated Created: 16/Nov/21  Updated: 29/Oct/23  Resolved: 01/Dec/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0, 4.4.12

Type: Bug Priority: Major - P3
Reporter: Andrew Shuvalov (Inactive) Assignee: Andrew Shuvalov (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.2, v4.4
Sprint: Sharding 2021-11-29, Sharding 2021-12-13
Participants:
Linked BF Score: 69

 Description   

Need to find the way to guarantee that the thread pool where Ldap connection reaper is running is terminated before the test end.

LDAPManagerImpl owns LDAPRunnerImpl, which owns LDAPConnectionFactory, which owns LDAPConnectionReaper. However the connection implementations (e.g. OpenLDAPConnection) also own a shared pointer to the LDAPConnectionReaper, which means deleting the LDAPConnectionFactory doesn't force the reaper to terminate.



 Comments   
Comment by Githook User [ 29/Dec/21 ]

Author:

{'name': 'Andrew Shuvalov', 'email': 'andrew.shuvalov@mongodb.com', 'username': 'shuvalov-mdb'}

Message: SERVER-61529 Ldap tests should wait for connection reaper to be terminated

(cherry picked from commit 0b5d1e58532747c9a228c07725b9a903542715da)
Branch: v4.4
https://github.com/10gen/mongo-enterprise-modules/commit/884edd7e0bb6c8811d21d8e500a5738f523204d8

Comment by Githook User [ 01/Dec/21 ]

Author:

{'name': 'Andrew Shuvalov', 'email': 'andrew.shuvalov@mongodb.com', 'username': 'shuvalov-mdb'}

Message: SERVER-61529 Ldap tests should wait for connection reaper to be terminated
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/0b5d1e58532747c9a228c07725b9a903542715da

Comment by Andrew Shuvalov (Inactive) [ 30/Nov/21 ]

Spoke with Mark, simple solution is ok because it's test only.

Comment by Andrew Shuvalov (Inactive) [ 30/Nov/21 ]

Hi mark.benvenuto I want to consult with you before fixing the race in the test. Essentially the LDAPConnectionReaper outlives the test suite. To fix the test I need a way to block for the reaper to terminate.

An easy way to fix this would be to just add a fail point in the ~LDAPConnectionReaper() destructor and wait for this point in tests. When reaper shared_ptr runs out of owners it means all connections made with this reaper are terminated. Are you ok with this simple fix or I need to find a way to make an explicit method to wait for the reaper termination?

Generated at Thu Feb 08 05:52:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.