Commit 7d51ac9
committed
keepalived: T9256: keep incomplete FIFO lines between reads
pipe_wait() reads at most 500 bytes per iteration and keeps no residual
buffer between them. A VRRP transition involving enough instances emits
more than that in a single burst, so a read lands mid-line: the tail of
one chunk is queued as an incomplete fragment and the head of the next
chunk as another.
The dispatcher then fails to match the notify regex on both halves and
silently runs no transition script. Observed on a pair with 14 instances
in one sync group, where "GROUP" arrived as "ROUP" because the leading
character ended the previous read.
Hold the incomplete trailing line and prepend it to the next read, so
only whole lines reach the queue. Only signal the processing thread when
at least one complete line was queued.1 parent b7e9483 commit 7d51ac9
1 file changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
160 | | - | |
161 | | - | |
162 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
163 | 175 | | |
164 | | - | |
| 176 | + | |
| 177 | + | |
165 | 178 | | |
166 | 179 | | |
167 | 180 | | |
| |||
0 commit comments