You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Joseph Wu (JIRA)" <ji...@apache.org> on 2017/03/07 00:02:33 UTC

[jira] [Commented] (MESOS-6919) Libprocess reinit code leaks SSL server socket FD

    [ https://issues.apache.org/jira/browse/MESOS-6919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15898414#comment-15898414 ] 

Joseph Wu commented on MESOS-6919:
----------------------------------

This leak is not strictly limited to the reinitialization logic.  Here is an even smaller repro (assuming libprocess is started with SSL):
{code}
  while (true) {
    Try<Socket> create = Socket::create();
    ASSERT_SOME(create);

    Socket* __s__ = new Socket(create.get());

    std::cout << "Test socket == " << __s__->get() << std::endl;

    Try<Address> bind = __s__->bind(Address::ANY_ANY());
    ASSERT_SOME(bind);

    Try<Nothing> listen = __s__->listen(10);
    ASSERT_SOME(listen)

    __s__->accept().discard();

    delete __s__;
    __s__ = nullptr;
  }
{code}

> Libprocess reinit code leaks SSL server socket FD
> -------------------------------------------------
>
>                 Key: MESOS-6919
>                 URL: https://issues.apache.org/jira/browse/MESOS-6919
>             Project: Mesos
>          Issue Type: Bug
>          Components: libprocess
>            Reporter: Greg Mann
>              Labels: libprocess, ssl
>
> After [this commit|https://github.com/apache/mesos/commit/789e9f7], it was discovered that tests which use {{process::reinitialize}} to switch between SSL and non-SSL modes will leak the file descriptor associated with the server socket {{\_\_s\_\_}}. This can be reproduced by running the following trivial test in repetition:
> {code}
> diff --git a/src/tests/scheduler_tests.cpp b/src/tests/scheduler_tests.cpp
> index 1ff423f..d5fd575 100644
> --- a/src/tests/scheduler_tests.cpp
> +++ b/src/tests/scheduler_tests.cpp
> @@ -1821,6 +1821,12 @@ INSTANTIATE_TEST_CASE_P(
>  #endif // USE_SSL_SOCKET
> +TEST_P(SchedulerSSLTest, LeakTest)
> +{
> +  ::sleep(1);
> +}
> +
> +
>  // Tests that a scheduler can subscribe, run a task, and then tear itself down.
>  TEST_P(SchedulerSSLTest, RunTaskAndTeardown)
>  {
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)