-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code, Networking
-
Server Programmability
-
Service Arch 2019-07-15, Service Arch 2019-08-12, Service Arch 2019-08-26, Service Arch 2019-09-09, Service Arch 2019-09-23, Service Arch 2019-10-07, Service Arch 2019-10-21
-
21
Currently whenever we bind a unix domain socket we first try to unlink it. This is to avoid a scenario where we crashed and left the old file around (because bind can't succeed if a file is already there).
Rather than performing that flow, if instead we:
if (bind()) { // we're bound, done! return; } if (non_blocking_connect_succeeds_or_fails_with_eagain()) { // someone else is listening, go away! fassert("address in use"); } // there's a file there, but no one listening. I.e. the old path unlink(); bind(); return;
Then we can avoid trampling on a running mongod and instead fail the process that's starting up
- related to
-
SERVER-41029 mongocryptd should not delete existing domain socket if it fails to start TCP socket
- Closed