-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mobile: Wait until the Engine is ready before calling terminate #34287
Conversation
/retest |
f052c23
to
fc37924
Compare
/retest |
/assign @alyssawilk @abeyad |
@@ -174,6 +177,7 @@ envoy_status_t InternalEngine::main(std::shared_ptr<Envoy::OptionsImplBase> opti | |||
server_->api().randomGenerator()); | |||
dispatcher_->drain(server_->dispatcher()); | |||
callbacks_->on_engine_running_(); | |||
engine_running_.Notify(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be added before the on_engine_running callback, in case e.g. that on_engine_running callback happens to block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Updated.
@@ -11,6 +11,9 @@ | |||
#include "library/common/stats/utility.h" | |||
|
|||
namespace Envoy { | |||
namespace { | |||
constexpr absl::Duration ENGINE_RUNNING_TIMEOUT = absl::Seconds(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, any idea how long average startup time is? I'm not sure what the typical range is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's typically really fast (less than 1 second). I put in 3 seconds and it's pretty arbitrary but I don't want it to wait indefinitely. I'm open to changing it to whatever timeout value that you think is more reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3s SGTM
Signed-off-by: Fredy Wijaya <[email protected]>
/retest |
When the
Engine
is not fully initialized, callingterminate()
will cause an assertion failure.This PR adds a workaround to wait until the
Engine
before proceeding to callterminate()
.Risk Level: low
Testing: unit tests
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: mobile