wwbmmm commented on PR #3767: URL: https://github.com/apache/brpc/pull/3767#issuecomment-7092602602
[replied by brpc-oncall robot] Confirmed and fixed. `copy_and_fill_server_options()` transfers ownership of the pointers in the caller's `ServerOptions` into `_options`, and the `enabled_protocols` validation ran after it, so a rejected configuration adopted pointers (e.g. `http_master_service`) that the caller may still own. `ValidateEnabledProtocols()` now takes the user-provided `ServerOptions` and runs right after the existing pre-adoption validations, before `copy_and_fill_server_options()`. A rejected `Start()` therefore leaves ownership untouched; the `http_master_service` test releases the pointer itself. Note: while stress-running `brpc_server_unittest` I hit a rare pre-existing hang during `Server::Join()` (`ordinary_services_are_not_served_on_internal_port`, ~1/20 full runs). I reproduced the same rate on the base commit 51e26d5a without this PR, so it is unrelated to this change. `brpc_server_unittest` passes all 58 tests. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
