[
https://issues.apache.org/jira/browse/THRIFT-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16400437#comment-16400437
]
James E. King, III edited comment on THRIFT-4515 at 3/16/18 8:28 PM:
---------------------------------------------------------------------
So far I have done:
* Teach C++ TestServer to ignore SIGPIPE, which allows it to exit gracefully
for SSL based tests.
* Have C++ TestServer block on a mutex in steady state. When unblocked, it
will stop the server.
* Fixed the cpp TestServer to handle SIGINT, and unblock the mutex.
* Added a server property in tests.json called stop_signal, the presence of
which triggers a more controlled shutdown using a signal.
* Have the cross test attempt to wait for server process to end gracefully
when stopped using a signal (instead of the old behavior which is to terminate
it rudely).
* If the wait for server process times out (2 seconds), it is killed rudely;
killing the server is now a cross test error as it means the server didn't stop
gracefully (for servers that support stopping by signal).
* Added dlang test server support for signal based test server shutdown.
* Added perl test server support for signal based test server shutdown;
curiously TServerSocker.pm did not define close() so I added it, and fixed the
TSimpleServer to end properly.
* Sadly all the remaining test servers also need this treatment, but this is a
lot of work, so it is left for the future.
* Fixed the C++ TSocket error message generator to put the path in the
description when it is a path-based socket.
Working through the test suite now to find any issues this uncovered.
was (Author: jking3):
So far I have done:
* Teach C++ TestServer to ignore SIGPIPE, which allows it to exit gracefully
for SSL based tests.
* Have C++ TestServer block on a mutex in steady state. When unblocked, it
will stop the server.
* Fixed the cpp TestServer to handle SIGINT, and unblock the mutex.
* Added a server property in tests.json called stop_signal, the presence of
which triggers a more controlled shutdown using a signal.
* Have the cross test attempt to wait for server process to end gracefully
when stopped using a signal (instead of the old behavior which is to terminate
it rudely).
* If the wait for server process times out (2 seconds), it is killed rudely;
killing the server is now a cross test error as it means the server didn't stop
gracefully (for servers that support stopping by signal).
* Added dlang test server support for signal based test server shutdown.
* Sadly all the remaining test servers also need this treatment.
Working through the test suite now to find any issues this uncovered.
> 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. In 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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)