Skip to content
Commit Detail

Commit a51adee

Author
Kenton Varda <kenton@cloudflare.com> 2024-06-19 12:59:22 -0500
Parents
259267a
Tree
0157ea2
Fix shutdown timing in inspector protocol.

`messagePump()` is defined as:

```
return receiveLoop().exclusiveJoin(dispatchLoop()).exclusiveJoin(transmitLoop());
```

`receiveLoop()` is responsible for receiving the final close message, and `transmitLoop()` is responsible for replying to it. This creates a race where `receiveLoop()` might receive the close message and exit before `transmitLoop()` can reply.

We can fix this by having `receiveLoop()` pause after receiving a close message. `transmitLoop()` will reply to it and then return, at which point `receiveLoop()` will be canceled anyway.

Files changed

1 file changed~1 modified