Commit 5c06377
Fix some unique session kick failures preventing clients to bind new sessions (#452)
* Remove UID from session pool and clean subscriptions correctly when kicking user
* Force close old session if kick fails when enforcing unique sessions
* Wrap errors within agent kick to facilitate debugging
* Add integration test case to validate unique sessions module basic behavior
* Use correct deadline exceeded error to validate write timeout
* Fix SessionCount being decremented if session is already closed and Close is called again
* Force close old session if kick fails due to 'use of closed connection' when enforcing unique sessions
* Improve logs
* Rename new unique session private method
* Add e2e test to validate unique session doesn't fail if kick fails
* Add comment to propose future improvement
* chore: update go to 1.23
* chore(ci): fix setup with goveralls deps
* feat(session): propagate network errors on Kick
Kick might fail due to encoding and verious network errors during
write. Also, if Kick tries to write to a closed connection (fd) it
would do so without timeout, defaulting to the OS timeouts in the
order of minutes. New Kick behavior does:
- Uses writeConnection that sets write deadlines
- Propagate encode errors so client can decide to retry
- Propagate network errors so client can decide to ignore
Knowing the error is specially useful in unique_session module, which
we need to ensure existing session is always closed, regardless of a
successful Kick.
---------
Co-authored-by: Felippe Durán <felippe.duran@wildlifestudios.com>
Co-authored-by: Pedro Soares <pedro.soares@wildlifestudios.com>1 parent e24f252 commit 5c06377
File tree
19 files changed
+634
-102
lines changed- .github/workflows
- agent
- e2e
- errors
- examples/testing
- helpers
- modules
- service
- session
- xk6-pitaya
19 files changed
+634
-102
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| 194 | + | |
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
| |||
320 | 322 | | |
321 | 323 | | |
322 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
323 | 332 | | |
324 | 333 | | |
325 | | - | |
326 | | - | |
| 334 | + | |
327 | 335 | | |
328 | | - | |
329 | | - | |
| 336 | + | |
330 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
331 | 341 | | |
332 | 342 | | |
333 | 343 | | |
| |||
346 | 356 | | |
347 | 357 | | |
348 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
349 | 366 | | |
350 | 367 | | |
351 | | - | |
352 | | - | |
| 368 | + | |
353 | 369 | | |
354 | | - | |
355 | | - | |
| 370 | + | |
356 | 371 | | |
357 | 372 | | |
| 373 | + | |
| 374 | + | |
358 | 375 | | |
359 | 376 | | |
360 | 377 | | |
| |||
368 | 385 | | |
369 | 386 | | |
370 | 387 | | |
371 | | - | |
372 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
373 | 393 | | |
374 | 394 | | |
375 | 395 | | |
| |||
408 | 428 | | |
409 | 429 | | |
410 | 430 | | |
411 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
412 | 471 | | |
413 | | - | |
414 | | - | |
| 472 | + | |
415 | 473 | | |
416 | 474 | | |
417 | 475 | | |
| |||
428 | 486 | | |
429 | 487 | | |
430 | 488 | | |
431 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
432 | 493 | | |
433 | 494 | | |
434 | 495 | | |
| |||
466 | 527 | | |
467 | 528 | | |
468 | 529 | | |
469 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
470 | 537 | | |
471 | 538 | | |
472 | 539 | | |
| |||
0 commit comments