Dear list,

I’ve recently opened an issue regarding a limitation of the “show proc” 
command, where the output is cut off after roughly 200 entries: 
https://github.com/haproxy/haproxy/issues/3204
This has been fixed in 
https://github.com/haproxy/haproxy/commit/594408cd612b5d80b7120d8a4f157f928ed38710
 by William L., thanks again!
I found that workers sharing the same timestamp still could be split across 
flushes: if a flush occurred mid-group and next_uptime advanced to that 
timestamp, resuming would include part of the group twice (duplicates).
Setting ctx->next_uptime to a group’s timestamp and then filtering with 
timestamp >= next_uptime re-includes that group when resuming, which causes 
duplicates unless you advance next_uptime past the group (or only update it on 
boundaries and ensure the group isn’t split).
To address this, I have included a bug fix that prevents these duplicate 
entries.  It works by grouping the entries by timestamp: same-second workers 
are emitted contiguously.

In theory, there is still a problem left with missing entries if there is a 
reload during the dump that has been also mentioned by William in the issue, 
but that is out of scope for now, I think.

I have attached a series of patches, patch 1 + 2 contain some rather trivial 
clean-ups, whereas patch 3 also provides a quick refactor, reducing the code 
duplication.
Because of this, I chose to put into 1 email to avoid overhead.
The bug fix itself is contained in patch 3, which ideally could also be 
backported. Let me know what you think! 😊

Best,

Alexander


Attachment: 0001-CLEANUP-mworker-cli-only-keep-positive-PIDs-in-proc_.patch
Description: 0001-CLEANUP-mworker-cli-only-keep-positive-PIDs-in-proc_.patch

Attachment: 0002-CLEANUP-mworker-remove-duplicate-list.h-include.patch
Description: 0002-CLEANUP-mworker-remove-duplicate-list.h-include.patch

Attachment: 0003-BUG-MINOR-mworker-cli-avoid-duplicates-in-show-proc.patch
Description: 0003-BUG-MINOR-mworker-cli-avoid-duplicates-in-show-proc.patch

Attachment: 0004-REORG-MINOR-mworker-cli-extract-shared-worker-row-pr.patch
Description: 0004-REORG-MINOR-mworker-cli-extract-shared-worker-row-pr.patch

Reply via email to