https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412020-11-03T18:13:24Zlighty labsLighttpd - Bug #3029: mod_wstunnel kills child on disconnect after idle-timeout from connection starthttps://redmine.lighttpd.net/issues/3029?journal_id=120402020-11-03T18:13:24Zgstrauss
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Invalid</i></li><li><strong>Target version</strong> deleted (<del><i>1.4.x</i></del>)</li></ul><p>mod_wstunnel connects to a backend <strong>socket</strong>.</p>
<p>As a convenience, mod_wstunnel can spawn a backend by configuring <code>"bin-path"</code>, and if you are using adaptive spawning, then set <code>"idle-timeout"</code> appropriate to your use.</p>
<p>documentation: <a class="wiki-page" href="https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ConfigurationOptions#gw_backend-gateway-server-host-options">gw_backend - gateway *.server host options</a></p>
<p>The behavior of <strong>your</strong> backend, including how it handles signals, is <strong>your</strong> code, not lighttpd.</p> Lighttpd - Bug #3029: mod_wstunnel kills child on disconnect after idle-timeout from connection starthttps://redmine.lighttpd.net/issues/3029?journal_id=120412020-11-04T02:48:51Zgstrauss
<ul></ul><blockquote>
<p>Instead, the child should be killed idle-timeout s after the it was actually used,</p>
</blockquote>
<p>yes</p>
<blockquote>
<p>maybe idle-timeout s after disconnect</p>
</blockquote>
<p>no</p>
<blockquote>
<p>or idle-timeout s after data was sent on the socket.</p>
</blockquote>
<p>yes</p> Lighttpd - Bug #3029: mod_wstunnel kills child on disconnect after idle-timeout from connection starthttps://redmine.lighttpd.net/issues/3029?journal_id=120422020-11-04T05:15:33Zgstrauss
<ul><li><strong>Subject</strong> changed from <i>mod_wstunnel instantly kills child on disconnect</i> to <i>mod_wstunnel kills child on disconnect after idle-timeout from connection start</i></li><li><strong>Status</strong> changed from <i>Invalid</i> to <i>Patch Pending</i></li><li><strong>Target version</strong> set to <i>1.4.56</i></li></ul><blockquote>
<p>The unused time is calculated based on last_used, however last_used is only updated when the child is spawned, when a client connects, and in gw_recv_response,</p>
</blockquote>
<p>yes</p>
<blockquote>
<p>which from what I understand is used when handling HTTP data.</p>
</blockquote>
<p>no. <code>gw_recv_response</code> is used when reading data from the backend, not just for HTTP data.</p>
<p>I have added to <code>gw_recv_response</code> some additional updates to <code>proc->last_used</code></p>
<p>However, for long-running backends, it would be better for you to manage the backend(s) yourself, e.g. an independent daemon listening on a socket and not started by lighttpd.</p> Lighttpd - Bug #3029: mod_wstunnel kills child on disconnect after idle-timeout from connection starthttps://redmine.lighttpd.net/issues/3029?journal_id=120432020-11-05T01:40:06Zgstrauss
<ul><li><strong>Status</strong> changed from <i>Patch Pending</i> to <i>Fixed</i></li></ul><p>Applied in changeset <a class="changeset" title="[core] set last_used on rd/wr from backend (fixes #3029) x-ref: "mod_wstunnel kills child on d..." href="https://redmine.lighttpd.net/projects/lighttpd/repository/14/revisions/639f70a00f2b723911bc5e3aaaddfdf9a47942e3">639f70a00f2b723911bc5e3aaaddfdf9a47942e3</a>.</p>