diff options
author | Richard Braun <rbraun@sceen.net> | 2014-02-22 17:16:17 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-02-22 17:16:17 +0100 |
commit | 235491231bdd1fd93507c835767503f047e10b91 (patch) | |
tree | f739d0afdf678b9b2cb62f33f1f0f6ce3e4f814a /libports | |
parent | dd07e7f7ddb5d704599f798a8ef3d1c8a05cb9bf (diff) |
libports: work around bugs in server termination
Most servers use ports_manage_port_operations_multithread to process
requests and terminate when it returns. Since many of them don't detach
before shutting down, a client may receive an error if its request
arrived while the server is shutting down. Prevent those spurious errors
by forcing ports_manage_port_operations_multithread not to return.
* libports/manage-multithread.c
(ports_manage_port_operations_multithread): Force global_timeout to 0.
Diffstat (limited to 'libports')
-rw-r--r-- | libports/manage-multithread.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libports/manage-multithread.c b/libports/manage-multithread.c index 64e442fe..2067cbaa 100644 --- a/libports/manage-multithread.c +++ b/libports/manage-multithread.c @@ -236,5 +236,11 @@ ports_manage_port_operations_multithread (struct port_bucket *bucket, return NULL; } + /* XXX It is currently unsafe for most servers to terminate based on + inactivity because a request may arrive after a server has started + shutting down, causing the client to receive an error. Prevent the + master thread from going away. */ + global_timeout = 0; + thread_function ((void *) 1); } |