- Notifications
You must be signed in to change notification settings - Fork1k
Commitb79785c
authored
feat: move agent v2 API connection monitoring to yamux layer (#11910)
Moves monitoring of the agent v2 API connection to the yamux layer.Present behavior monitors this at the websocket layer, and closes the websocket on completion. This can cause yamux to hit unexpected errors since the connection is closed underneath it.This might be the cause of yamux errors that some customers are seeingIn any case, it's more graceful to close yamux first and let yamux close the underlying websocket. That should limit yamux error logging to truly unexpected/error cases.The only downside is that the yamux `Close()` doesn't accept a reason, so if the agent becomes outdated and we close the API connection, the agent just sees the connection close without a reason. I'm not sure we log this at the agent anyway, but it would be nice. I think more accurate logging on Coderd are more important.I've also added some logging when the monitor disconnects for reasons other than the context being canceled (e.g. agent outdated, failed pings).1 parent13e214f commitb79785c
File tree
2 files changed
+71
-23
lines changed- coderd
2 files changed
+71
-23
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
113 | 113 |
| |
114 | 114 |
| |
115 | 115 |
| |
116 |
| - | |
117 |
| - | |
118 | 116 |
| |
119 | 117 |
| |
120 |
| - | |
| 118 | + | |
121 | 119 |
| |
122 | 120 |
| |
123 | 121 |
| |
| |||
214 | 212 |
| |
215 | 213 |
| |
216 | 214 |
| |
217 |
| - | |
218 |
| - | |
| 215 | + | |
| 216 | + | |
219 | 217 |
| |
220 | 218 |
| |
221 | 219 |
| |
| |||
236 | 234 |
| |
237 | 235 |
| |
238 | 236 |
| |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
239 | 284 |
| |
240 | 285 |
| |
241 | 286 |
| |
| |||
245 | 290 |
| |
246 | 291 |
| |
247 | 292 |
| |
248 |
| - | |
| 293 | + | |
249 | 294 |
| |
250 | 295 |
| |
251 | 296 |
| |
| |||
272 | 317 |
| |
273 | 318 |
| |
274 | 319 |
| |
275 |
| - | |
| 320 | + | |
276 | 321 |
| |
277 | 322 |
| |
278 | 323 |
| |
| |||
295 | 340 |
| |
296 | 341 |
| |
297 | 342 |
| |
298 |
| - | |
| 343 | + | |
299 | 344 |
| |
300 | 345 |
| |
301 | 346 |
| |
| |||
314 | 359 |
| |
315 | 360 |
| |
316 | 361 |
| |
317 |
| - | |
| 362 | + | |
318 | 363 |
| |
319 | 364 |
| |
320 | 365 |
| |
| |||
331 | 376 |
| |
332 | 377 |
| |
333 | 378 |
| |
334 |
| - | |
| 379 | + | |
335 | 380 |
| |
336 | 381 |
| |
337 | 382 |
| |
| |||
346 | 391 |
| |
347 | 392 |
| |
348 | 393 |
| |
349 |
| - | |
| 394 | + | |
350 | 395 |
| |
351 | 396 |
| |
352 | 397 |
| |
| |||
384 | 429 |
| |
385 | 430 |
| |
386 | 431 |
| |
387 |
| - | |
| 432 | + | |
388 | 433 |
| |
389 | 434 |
| |
390 | 435 |
| |
| |||
409 | 454 |
| |
410 | 455 |
| |
411 | 456 |
| |
| 457 | + | |
412 | 458 |
| |
413 | 459 |
| |
414 | 460 |
| |
| |||
421 | 467 |
| |
422 | 468 |
| |
423 | 469 |
| |
| 470 | + | |
424 | 471 |
| |
425 | 472 |
| |
426 | 473 |
| |
| |||
429 | 476 |
| |
430 | 477 |
| |
431 | 478 |
| |
| 479 | + | |
432 | 480 |
| |
433 | 481 |
| |
434 | 482 |
| |
435 | 483 |
| |
436 | 484 |
| |
437 |
| - | |
| 485 | + | |
438 | 486 |
| |
439 | 487 |
| |
440 | 488 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| |||
97 | 97 |
| |
98 | 98 |
| |
99 | 99 |
| |
100 |
| - | |
| 100 | + | |
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
| |||
119 | 119 |
| |
120 | 120 |
| |
121 | 121 |
| |
122 |
| - | |
| 122 | + | |
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
| |||
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
160 |
| - | |
| 160 | + | |
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
| |||
179 | 179 |
| |
180 | 180 |
| |
181 | 181 |
| |
182 |
| - | |
| 182 | + | |
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
| |||
217 | 217 |
| |
218 | 218 |
| |
219 | 219 |
| |
220 |
| - | |
| 220 | + | |
221 | 221 |
| |
222 | 222 |
| |
223 | 223 |
| |
224 | 224 |
| |
225 |
| - | |
| 225 | + | |
226 | 226 |
| |
227 | 227 |
| |
228 | 228 |
| |
| |||
238 | 238 |
| |
239 | 239 |
| |
240 | 240 |
| |
241 |
| - | |
| 241 | + | |
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
| |||
259 | 259 |
| |
260 | 260 |
| |
261 | 261 |
| |
262 |
| - | |
| 262 | + | |
263 | 263 |
| |
264 | 264 |
| |
265 | 265 |
| |
|
0 commit comments
Comments
(0)