streaming: Print on_remove and on_restart log when peer exists
We print the following messages even if there is no stream_session with that peer. It is a bit confusing. INFO 2016-09-23 08:26:37,254 [shard 0] stream_session - stream_manager: Close all stream_session with peer = 127.0.0.1 in on_restart INFO 2016-09-23 08:26:37,287 [shard 0] stream_session - stream_manager: Close all stream_session with peer = 127.0.0.3 in on_remove Print only when the streaming session with the peer exists.
This commit is contained in:
@@ -238,21 +238,25 @@ void stream_manager::fail_sessions(inet_address endpoint) {
|
||||
}
|
||||
|
||||
void stream_manager::on_remove(inet_address endpoint) {
|
||||
sslog.info("stream_manager: Close all stream_session with peer = {} in on_remove", endpoint);
|
||||
get_stream_manager().invoke_on_all([endpoint] (auto& sm) {
|
||||
sm.fail_sessions(endpoint);
|
||||
}).handle_exception([endpoint] (auto ep) {
|
||||
sslog.warn("stream_manager: Fail to close sessions peer = {} in on_remove", endpoint);
|
||||
});
|
||||
if (has_peer(endpoint)) {
|
||||
sslog.info("stream_manager: Close all stream_session with peer = {} in on_remove", endpoint);
|
||||
get_stream_manager().invoke_on_all([endpoint] (auto& sm) {
|
||||
sm.fail_sessions(endpoint);
|
||||
}).handle_exception([endpoint] (auto ep) {
|
||||
sslog.warn("stream_manager: Fail to close sessions peer = {} in on_remove", endpoint);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void stream_manager::on_restart(inet_address endpoint, endpoint_state ep_state) {
|
||||
sslog.info("stream_manager: Close all stream_session with peer = {} in on_restart", endpoint);
|
||||
get_stream_manager().invoke_on_all([endpoint] (auto& sm) {
|
||||
sm.fail_sessions(endpoint);
|
||||
}).handle_exception([endpoint] (auto ep) {
|
||||
sslog.warn("stream_manager: Fail to close sessions peer = {} in on_restart", endpoint);
|
||||
});
|
||||
if (has_peer(endpoint)) {
|
||||
sslog.info("stream_manager: Close all stream_session with peer = {} in on_restart", endpoint);
|
||||
get_stream_manager().invoke_on_all([endpoint] (auto& sm) {
|
||||
sm.fail_sessions(endpoint);
|
||||
}).handle_exception([endpoint] (auto ep) {
|
||||
sslog.warn("stream_manager: Fail to close sessions peer = {} in on_restart", endpoint);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace streaming
|
||||
|
||||
Reference in New Issue
Block a user