Repository navigation
Commit 36e914a
committed
Use stable ZMQ identity for minion + syndic daemon ret-port REQ sockets
libzmq's ROUTER socket does not reclaim per-peer routing-id table
entries when a TCP peer disconnects -- they live until the same
routing-id reconnects (and ROUTER_HANDOVER=1 replaces them). Minions
have been connecting without setting ZMQ_IDENTITY, so every reconnect
generated a fresh random routing-id and a fresh leaked peer entry on
the master's MWorkerQueue ROUTER. Under sustained stress that process
was observed leaking +23 GB / 2 days on a 3-minion soak.
Set a stable, per-AsyncReqMessageClient-instance identity on minion
and syndic daemons (mirroring what was already done for the CLI):
* a process-lifetime counter ensures siblings within one process get
different identities -- the previous syndic CI failure came from
giving every sibling the same identity, which triggered
ROUTER_HANDOVER on the master to drop in-flight replies;
* the same socket instance reuses its slot across libzmq reconnects,
so the master's ROUTER replaces the prior peer entry instead of
leaking one per reconnect;
* on daemon restart, slots replay in construction order so the prior
entries get overwritten cleanly.1 parent 40febc8 commit 36e914a
1 file changed
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
| |||
631 | 643 | | |
632 | 644 | | |
633 | 645 | | |
634 | | - | |
635 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
636 | 650 | | |
637 | 651 | | |
638 | 652 | | |
| |||
644 | 658 | | |
645 | 659 | | |
646 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
647 | 679 | | |
648 | 680 | | |
649 | 681 | | |
| |||
0 commit comments