collector/filesystem: s/MNT_NOWAIT/MNT_WAIT#2960
collector/filesystem: s/MNT_NOWAIT/MNT_WAIT#2960rexagod wants to merge 1 commit intoprometheus:masterfrom
s/MNT_NOWAIT/MNT_WAIT#2960Conversation
d9f495a to
514d009
Compare
`getfsstat(2)` spec mentions that using `MNT_NOWAIT` will return the information it has available without requesting an update from each file system. Hence, use `MNT_WAIT` in place of the earlier used mode, and make changes to the affected collectors to avoid being stuck for long intervals. Fixes: prometheus#1498 Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
|
I wonder if we could refactor the timeout logic implemented in https://github.com/prometheus/node_exporter/pull/997/files and re-use it here? |
|
@discordianfish Sure! Do you think it'd be better to do that in a separate PR? |
|
@rexagod I think you can just do it here and use to to address the MNT_WAIT change |
|
@discordianfish I revisited the machinery introduced in #997, and although it seems fitting for that use case, I've had to drop it entirely in this patch to accommodate for the varying design patterns for different filesystems. As such, I believe a per-filesystem case makes sense here since encapsulating that logic such that it fits all filesystems can get non-scalable in the future as more corner cases are added to satisfy the various implementations. Please note that while the previous machinery is being dropped here, the expected behavior is still the same. LMK if you think otherwise, though. :) |
|
Would be nice if we could avoid duplicating the channel/goroutine/timeout logic |
|
So I ended up taking a couple of stabs at this, but I believe that the refactor (that essentially takes the goroutine, channel, and the timeout logic into a common place may add up to the maintenance complexity, since there are different APIs being used between PLMK there's anything I'm missing that could help address your earlier comment. |
getfsstat(2)spec mentions that usingMNT_NOWAITwill return the information it has available without requesting an update from each file system. Hence, useMNT_WAITin place of the earlier used mode, and make changes to the affected collectors to avoid being stuck for long intervals.Fixes: #1498