Commit 1590f7d
committed
fix: socket connection timeout
Context:
- okhttp uses an HTTP/2 connection to the coder rest api in order to resolves
the workspaces.
- HTTP/2 uses a single TCP connection for multiple requests (multiplexing).
If the connection is idle, the http server can close that connection, with client side ending in a socket timeout if it doesn't detect the drop in time.
- similarly on the client side, if the OS goes into sleep mode, the
connection might have been interrupted. HTTP/2 doesn't always detect this
quickly, leading to stale streams when Toolbox wakes up.
Implementation:
- we could try to force the client to use HTTP/1 which creates a TCP
connection for each request, but from my testing it seems that configuring
a retry strategy when a client attempts to reuse a TCP connection that
has unexpectedly closed does the job.
- resolves #131 parent da7656f commit 1590f7d
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
0 commit comments