You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Erik Frey (JIRA)" <ji...@apache.org> on 2008/09/25 23:53:44 UTC

[jira] Created: (THRIFT-149) TNonBlockingServer graceful shutdown

TNonBlockingServer graceful shutdown
------------------------------------

                 Key: THRIFT-149
                 URL: https://issues.apache.org/jira/browse/THRIFT-149
             Project: Thrift
          Issue Type: Improvement
          Components: Library (C++)
            Reporter: Erik Frey
            Priority: Minor


There doesn't seem to be a way to gracefully shutdown TNonBlockingServer - this patch is a start.  It allows TNonBlockingServer to gracefully handle a ThreadManager that's being stopped (and finishing up its workers) -- if it catches an IllegalStateException when it tries to add a task, it simply closes the connection.

This allows the server implementor to stop the thread manager first, then dismantle the rest of the server.  Clients that made it through before the thread manager was stopped receive a response, and clients after receive an abruptly closed connection.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-149) TNonBlockingServer graceful shutdown

Posted by "Erik Frey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637874#action_12637874 ] 

Erik Frey commented on THRIFT-149:
----------------------------------

The other half of the equation, I think, would be for TNonBlockingServer to implement stop():

* interrupt the server socket
* wait for any tasks that are in the APP_SEND_RESULT state - unfortunately, i don't think this change is a one or two-line patch

> TNonBlockingServer graceful shutdown
> ------------------------------------
>
>                 Key: THRIFT-149
>                 URL: https://issues.apache.org/jira/browse/THRIFT-149
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Library (C++)
>            Reporter: Erik Frey
>            Priority: Minor
>         Attachments: nonblocking_graceful_shutdown.patch
>
>
> There doesn't seem to be a way to gracefully shutdown TNonBlockingServer - this patch is a start.  It allows TNonBlockingServer to gracefully handle a ThreadManager that's being stopped (and finishing up its workers) -- if it catches an IllegalStateException when it tries to add a task, it simply closes the connection.
> This allows the server implementor to stop the thread manager first, then dismantle the rest of the server.  Clients that made it through before the thread manager was stopped receive a response, and clients after receive an abruptly closed connection.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-149) TNonBlockingServer graceful shutdown

Posted by "Erik Frey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erik Frey updated THRIFT-149:
-----------------------------

    Attachment: nonblocking_graceful_shutdown.patch

Patch to TNonBlockingServer to handle IllegalStateException from ThreadManager.

> TNonBlockingServer graceful shutdown
> ------------------------------------
>
>                 Key: THRIFT-149
>                 URL: https://issues.apache.org/jira/browse/THRIFT-149
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Library (C++)
>            Reporter: Erik Frey
>            Priority: Minor
>         Attachments: nonblocking_graceful_shutdown.patch
>
>
> There doesn't seem to be a way to gracefully shutdown TNonBlockingServer - this patch is a start.  It allows TNonBlockingServer to gracefully handle a ThreadManager that's being stopped (and finishing up its workers) -- if it catches an IllegalStateException when it tries to add a task, it simply closes the connection.
> This allows the server implementor to stop the thread manager first, then dismantle the rest of the server.  Clients that made it through before the thread manager was stopped receive a response, and clients after receive an abruptly closed connection.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-149) TNonBlockingServer graceful shutdown

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Reiss updated THRIFT-149:
-------------------------------

    Patch Info:   (was: [Patch Available])

> TNonBlockingServer graceful shutdown
> ------------------------------------
>
>                 Key: THRIFT-149
>                 URL: https://issues.apache.org/jira/browse/THRIFT-149
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Library (C++)
>            Reporter: Erik Frey
>            Priority: Minor
>         Attachments: nonblocking_graceful_shutdown.patch
>
>
> There doesn't seem to be a way to gracefully shutdown TNonBlockingServer - this patch is a start.  It allows TNonBlockingServer to gracefully handle a ThreadManager that's being stopped (and finishing up its workers) -- if it catches an IllegalStateException when it tries to add a task, it simply closes the connection.
> This allows the server implementor to stop the thread manager first, then dismantle the rest of the server.  Clients that made it through before the thread manager was stopped receive a response, and clients after receive an abruptly closed connection.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-149) TNonBlockingServer graceful shutdown

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637775#action_12637775 ] 

David Reiss commented on THRIFT-149:
------------------------------------

I committed this patch, but I'm leaving the issue open since it is not a complete solution.

> TNonBlockingServer graceful shutdown
> ------------------------------------
>
>                 Key: THRIFT-149
>                 URL: https://issues.apache.org/jira/browse/THRIFT-149
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Library (C++)
>            Reporter: Erik Frey
>            Priority: Minor
>         Attachments: nonblocking_graceful_shutdown.patch
>
>
> There doesn't seem to be a way to gracefully shutdown TNonBlockingServer - this patch is a start.  It allows TNonBlockingServer to gracefully handle a ThreadManager that's being stopped (and finishing up its workers) -- if it catches an IllegalStateException when it tries to add a task, it simply closes the connection.
> This allows the server implementor to stop the thread manager first, then dismantle the rest of the server.  Clients that made it through before the thread manager was stopped receive a response, and clients after receive an abruptly closed connection.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.