summaryrefslogtreecommitdiffhomepage
path: root/control/controlhttp/controlhttpserver/controlhttpserver.go
diff options
context:
space:
mode:
authorNick Khyl <nickk@tailscale.com>2025-01-13 18:20:09 -0600
committerNick Khyl <1761190+nickkhyl@users.noreply.github.com>2025-01-14 15:54:43 -0600
commit6fac2903e1146164b2a587fd36d53a083ac7e98c (patch)
treeacdfba017316f9be9c5b1ec4a834f4fdbb3e3051 /control/controlhttp/controlhttpserver/controlhttpserver.go
parentf33f5f99c00f187644bf807b5336e2008e0228b7 (diff)
downloadtailscale-6fac2903e1146164b2a587fd36d53a083ac7e98c.tar.xz
tailscale-6fac2903e1146164b2a587fd36d53a083ac7e98c.zip
ipn/ipnserver: fix race condition where LocalBackend is reset after a different user connects
In this commit, we add a failing test to verify that ipn/ipnserver.Server correctly sets and unsets the current user when two different clients send requests concurrently (A sends request, B sends request, A's request completes, B's request completes). The expectation is that the user who wins the race becomes the current user from the LocalBackend's perspective, remaining in this state until they disconnect, after which a different user should be able to connect and use the LocalBackend. We then fix the second of two bugs in (*Server).addActiveHTTPRequest, where a race condition causes the LocalBackend's state to be reset after a new client connects, instead of after the last active request of the previous client completes and the server becomes idle. Fixes tailscale/corp#25804 Signed-off-by: Nick Khyl <nickk@tailscale.com>
Diffstat (limited to 'control/controlhttp/controlhttpserver/controlhttpserver.go')
0 files changed, 0 insertions, 0 deletions