[ https://issues.apache.org/jira/browse/MESOS-4153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anand Mazumdar updated MESOS-4153: ---------------------------------- Description: The {{disconnected}} callback is never invoked when a local/remote libprocess {{process}} terminates. Here is a sample test that shows that the returned future from {{disconnect()}} is never fulfilled. {code} TEST(HTTPConnectionTest, Disconnected) { Option<http::Connection> connection; Future<Nothing> disconnected; { Http http; http::URL url = http::URL( "http", http.process->self().address.ip, http.process->self().address.port, http.process->self().id + "/get"); Future<http::Connection> connect = http::connect(url); AWAIT_READY(connect); connection = connect.get(); disconnected = connection->disconnected(); } AWAIT_READY(disconnected); } {code} The {{Http}} class refers to the one used in the tests: https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/tests/http_tests.cpp#L114 The following test passes i.e. when the client explicitly invokes {{disconnect()}}: {code} TEST(HTTPConnectionTest, Disconnected) { Option<http::Connection> connection; Future<Nothing> disconnected; { Http http; http::URL url = http::URL( "http", http.process->self().address.ip, http.process->self().address.port, http.process->self().id + "/get"); Future<http::Connection> connect = http::connect(url); AWAIT_READY(connect); connection = connect.get(); disconnected = connection->disconnected(); } AWAIT_READY(connection->disconnect()); AWAIT_READY(disconnected); } {code} was: The {{disconnected}} callback is never invoked when a local/remote libprocess {{process}} terminates. Here is a sample test that shows that the returned future from {{disconnect()}} is never fulfilled. {code} TEST(HTTPConnectionTest, Disconnected) { Option<http::Connection> connection; Future<Nothing> disconnected; { Http http; http::URL url = http::URL( "http", http.process->self().address.ip, http.process->self().address.port, http.process->self().id + "/get"); Future<http::Connection> connect = http::connect(url); AWAIT_READY(connect); connection = connect.get(); disconnected = connection->disconnected(); } AWAIT_READY(disconnected); } {code} The {{Http}} class refers to the one used in the tests: https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/tests/http_tests.cpp#L114 The following test passes: {code} TEST(HTTPConnectionTest, Disconnected) { Option<http::Connection> connection; Future<Nothing> disconnected; { Http http; http::URL url = http::URL( "http", http.process->self().address.ip, http.process->self().address.port, http.process->self().id + "/get"); Future<http::Connection> connect = http::connect(url); AWAIT_READY(connect); connection = connect.get(); disconnected = connection->disconnected(); } AWAIT_READY(connection->disconnect()); AWAIT_READY(disconnected); } {code} > process::Connection does not invoke the disconnected callback when remote > process exits > --------------------------------------------------------------------------------------- > > Key: MESOS-4153 > URL: https://issues.apache.org/jira/browse/MESOS-4153 > Project: Mesos > Issue Type: Bug > Components: libprocess > Reporter: Anand Mazumdar > Labels: http > > The {{disconnected}} callback is never invoked when a local/remote libprocess > {{process}} terminates. Here is a sample test that shows that the returned > future from {{disconnect()}} is never fulfilled. > {code} > TEST(HTTPConnectionTest, Disconnected) > { > Option<http::Connection> connection; > Future<Nothing> disconnected; > { > Http http; > http::URL url = http::URL( > "http", > http.process->self().address.ip, > http.process->self().address.port, > http.process->self().id + "/get"); > Future<http::Connection> connect = http::connect(url); > AWAIT_READY(connect); > connection = connect.get(); > disconnected = connection->disconnected(); > } > AWAIT_READY(disconnected); > } > {code} > The {{Http}} class refers to the one used in the tests: > https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/tests/http_tests.cpp#L114 > The following test passes i.e. when the client explicitly invokes > {{disconnect()}}: > {code} > TEST(HTTPConnectionTest, Disconnected) > { > Option<http::Connection> connection; > Future<Nothing> disconnected; > { > Http http; > http::URL url = http::URL( > "http", > http.process->self().address.ip, > http.process->self().address.port, > http.process->self().id + "/get"); > Future<http::Connection> connect = http::connect(url); > AWAIT_READY(connect); > connection = connect.get(); > disconnected = connection->disconnected(); > } > AWAIT_READY(connection->disconnect()); > AWAIT_READY(disconnected); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)