[CDRIVER-3752] Missing call to bson_mutex_unlock in _mongoc_client_pool_set_internal_tls_opts Created: 16/Jul/20 Updated: 28/Oct/23 Resolved: 16/Jul/20 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.17.0-beta |
| Fix Version/s: | 1.18.0, 1.18.0-alpha |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Kevin Albertson | Assignee: | Kevin Albertson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
A call to bson_mutex_unlock was omitted in this commit: https://github.com/mongodb/mongo-c-driver/commit/7f785ffedb679b1fb5c62ae0369dec218980a016#diff-2a89b54dc123a4ba94a2a069c6aa70e6R85 when adding support for new TLS options for OCSP. |
| Comments |
| Comment by Githook User [ 16/Jul/20 ] | |||||||||
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message: | |||||||||
| Comment by Kevin Albertson [ 16/Jul/20 ] | |||||||||
| Comment by Kevin Albertson [ 16/Jul/20 ] | |||||||||
|
Upon further inspection, I don't think this is currently reproducible based on how _mongoc_client_pool_set_internal_tls_opts is called. The only caller of _mongoc_client_pool_set_internal_tls_opts is this snippet:
The first call to mongoc_client_pool_set_ssl_opts is necessarily called with a non-NULL ssl_opt, and that will set the pool->ssl_opts_set = true. The deadlock in question cannot occur because the check will always be false. Regardless, it would be an improvement to unlock before returning to prevent the possibility of a future deadlock. |