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

ASF GitHub Bot commented on THRIFT-4515:
----------------------------------------

GitHub user jeking3 opened a pull request:

    https://github.com/apache/thrift/pull/1509

    THRIFT-4515: cross server test improvement: graceful test server shutdown

    ### Problem ###
    Test servers are not shut down gracefully - they are SIGKILLed once the 
client exits.
    
    ### Solution ###
    Try using SIGINT first, capture the result code and process it properly, 
SIGKILL if the process seems unresponsive.
    
    ### Also ###
    - Better subprocess management in cross test requires Python 3.3 or later 
to run the suite.
    - tests.json can declare "stop_signal": <n> in the server stanza to 
customize this behavior
    - Added signal handling to C++, D, and Perl test servers to stop gracefully.
    - Cleaned up some C++ library compiler warnings.
    - Fixed C++ TSocket error descriptions for domain sockets to use the path 
instead of host/port.
    - Fixed an intermittent issue in concurrency_test.
    - Perl server had no "stop()" mechanism which was easy to add.
    - Updated SBCL (lisp) to 1.4.5 to try and eliminate these "file not found" 
sporadic build issues.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jeking3/thrift THRIFT-4515

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/1509.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1509
    
----
commit f1905707c0f7be34e811d2dc4af50a6e06a01364
Author: James E. King III <jking@...>
Date:   2018-03-16T20:07:42Z

    THRIFT-4515: cross server test improvement: graceful test server shutdown

commit 8e116b9af11dc1533725f7806f73ffadff442524
Author: James E. King III <jking@...>
Date:   2018-03-19T12:16:51Z

    THRIFT-82: move to SBCL 1.4.5 (hopefully will address 1.4.4 sporadic build 
errors)

----


> Gracefully shutdown cross-test servers to fully test teardown
> -------------------------------------------------------------
>
>                 Key: THRIFT-4515
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4515
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Test Suite
>    Affects Versions: 0.11.0
>            Reporter: James E. King, III
>            Assignee: James E. King, III
>            Priority: Major
>
> The cross test suite kills the server process after the client is done, see 
> test/crosstest/run.py:_scoped, the process is killed. This means that we 
> don't ever test teardown in any language in our cross tests.  Further, in 
> some servers like the C++ TestServer, code at the end of main it sits in a 
> TIGHT while loop unnecessarily causing CPU usage and slowing down the system.
> There should be a signal (like SIGINT) that each server waits for, and on 
> receiving that signal stops the thrift server cleanly.  This ensures we 
> properly test teardown.
> h4. Design
> There is a new property in the tests.json file under server called 
> "stop_signal".  If defined, the server understands how to stop when given 
> this signal.  The cross test suite honors this.  Currently the cpp, d, and 
> perl servers handle it properly.
> When a server handles this signal, if the server dies unexpectedly or fails 
> to stop that is considered an error.  The old behavior is applied to any 
> legacy server which doesn't understand how to use a signal to stop.  In that 
> case the server is killed with SIGKILL (unconditionally) and any result is 
> ignored.
> All test servers should be updated to support this new mechanism as soon as 
> possible so that we improve test coverage of server stop / teardown code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to