empiredan commented on code in PR #1418:
URL:
https://github.com/apache/incubator-pegasus/pull/1418#discussion_r1151483758
##########
src/server/pegasus_service_app.h:
##########
@@ -57,11 +59,13 @@ class pegasus_replication_service_app : public
::dsn::replication::replication_s
::dsn::error_code ret =
::dsn::replication::replication_service_app::stop();
if (_updater_started) {
pegasus_counter_reporter::instance().stop();
+ _builtin_metrics.stop();
}
return ret;
}
private:
+ dsn::builtin_metrics _builtin_metrics;
bool _updater_started;
Review Comment:
`service_app::start(...)` (such as
`dsn::replication::replication_service_app::start(args_new)`) will return an
error code. Once this error code is not `ERR_OK`, metric service will not be
started. That's why `_updater_started ` is involved.
We can do another CHECK for the returned error code by
`service_app::start(...)`. Actually the root caller, `start_app()` in
service_control_task::exec() will also do CHECK for `ERR_OK`. Do CHECK here to
guarantee that all following services (such as built-in metrics) are started,
then `_updater_started ` could be removed.
--
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]