nathanlo-hrt opened a new pull request, #2598: URL: https://github.com/apache/kvrocks/pull/2598
When spawning Kvrocks as a part of a script, it's sometimes helpful to first reserve a port with a socket, and pass that socket to Kvrocks as a child process. This change implements this change: 1. Adds a config item `socket-fd` which defaults to -1 (no fd specified). 2. If `socket-fd` is provided, will skip checking that the supplied port is available (since it will already be grabbed by the provided fd). Instead, it will check that the supplied fd is indeed a socket associated to the provided port. 3. If `socket-fd` is provided, `Worker`'s will `dup` the supplied fd and listen to that instead of trying to make their own socket from scratch. 4. Close `socket-fd` on shut-down. As a bonus, removed some unneeded indirect includes and cleaned up some surrounding code. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
