Commit 0a6ec71
committed
Fix syndic cluster mode timeout by enabling /new event forwarding
This fixes a regression introduced in commit 0643102 that prevented
Salt CLI from exiting promptly when using syndics in cluster mode, causing
200+ second timeouts instead of the expected ~15 second completion.
The issue had TWO related bugs:
1. **Syndic event forwarding logic (salt/minion.py)**
- The syndic was setting return_event=False for ALL events with matching
master_id, including /new events with minions lists
- Changed to only set return_event=False for job RETURN events
- Fixed salt.utils.jid.is_jid(mtag) check which failed for event tags
like "salt/job/{jid}/new" (checks if entire string is JID, not if it
contains one)
- Now uses job_event variable which correctly identifies job events
2. **Master event blacklist logic (salt/daemons/masterapi.py)**
- Minion event blacklist includes "salt/job/*/new" to prevent minions
from spoofing job events
- When syndics forward events with pretag="syndic/{id}", the pretagged
event should bypass the blacklist as "syndic/{id}/salt/job/{jid}/new"
- Bug: The `continue` statement skipped BOTH the original event AND
the pretagged event when original tag was blacklisted
- Fix: Fire pretagged event BEFORE checking blacklist, so syndic events
are always forwarded with syndic/ prefix even if original tag is
blacklisted
Result:
- Master of Masters now receives minions list from syndic via
syndic/{id}/salt/job/{jid}/new events
- Early-exit logic can trigger when all expected returns are received
- test_syndic_target_single_minion now passes in ~40s instead of timing
out at 200s1 parent 5e4fa4b commit 0a6ec71
2 files changed
+17
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
823 | 822 | | |
824 | 823 | | |
825 | 824 | | |
826 | 825 | | |
827 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
828 | 832 | | |
829 | 833 | | |
830 | 834 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3901 | 3901 | | |
3902 | 3902 | | |
3903 | 3903 | | |
3904 | | - | |
3905 | | - | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
3906 | 3912 | | |
3907 | 3913 | | |
3908 | 3914 | | |
| |||
3952 | 3958 | | |
3953 | 3959 | | |
3954 | 3960 | | |
3955 | | - | |
| 3961 | + | |
3956 | 3962 | | |
3957 | 3963 | | |
3958 | 3964 | | |
| |||
0 commit comments