mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-02 04:46:41 -05:00
fix: saturate the process thread queue depth instead of overflowing
- process-thread-queue-depth is multiplied by the process thread count. A large depth overflowed the int, e.g. process-thread-queue-depth=1073741824 with 2 process threads, which is undefined behaviour. - Cap the product at INT_MAX. The queue only counts free slots, so a depth that large is unbounded in practice, as asked for.
This commit is contained in:
parent
0a82dfe2e0
commit
4434e3ba62
2 changed files with 11 additions and 4 deletions
|
|
@ -61,8 +61,8 @@ in the pool.
|
|||
|
||||
* `process-thread-queue-depth=N` where `N>0`: Sets the number of
|
||||
outstanding requests that the process thread pool can have to `N *
|
||||
process-thread-count`. If requests come in faster than can be
|
||||
processed and the max queue depth hit then queuing the request will
|
||||
block in order to limit memory growth.
|
||||
process-thread-count`, at most 2147483647. If requests come in
|
||||
faster than can be processed and the max queue depth hit then
|
||||
queuing the request will block in order to limit memory growth.
|
||||
* `process-thread-queue-depth<=0`: Sets the queue depth to 2. May be
|
||||
used in the future to set dynamically.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue