Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4515

Gracefully shutdown cross-test servers to fully test teardown



    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.0
    • Fix Version/s: 0.12.0
    • Component/s: Test Suite
    • Labels:


      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.


      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.


          Issue Links



              • Assignee:
                jking3 James E. King III
                jking3 James E. King III
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: