mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-07 12:31:56 +00:00
32900556e0
* claim: #8315 * fix(control-server): release the watch seat deterministically (#8315) The seat a subscribed connection holds on the DesignWatch lived in the events thread alone, so it left the watch only when that thread ended: on the first write a closed client refuses, which needs the design to move, or when the thread noticed the end of the stream, which waits for the connection's own thread to come out of its blocking read. A closed connection could therefore keep counting on the watch for a second or more, and the test that asks for the count to be gone could lose its race with the ten seconds it waits. The seat is now shared: it leaves the watch once, whichever thread sees the connection's end first, the connection's own thread at the end of the stream or the events thread at the first refused write. The count of subscribed connections is right as soon as the connection is gone, and the events a subscribed connection is told of do not change.