Skip to content

[0.12 backport] executor/resource: stub out NewSysSampler on Windows#4042

Merged
jedevc merged 1 commit intomoby:v0.12from
thaJeztah:0.12_backport_windows_no_proc
Jul 20, 2023
Merged

[0.12 backport] executor/resource: stub out NewSysSampler on Windows#4042
jedevc merged 1 commit intomoby:v0.12from
thaJeztah:0.12_backport_windows_no_proc

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Commit 509cfa3 (#3860) introduced the SysSampler, which measures resource consumption. However, for this it depends on prometheus' procfs. That package does not have build-tags but is a Linux-only implementation, which (by default) attempts to access /proc; https://github.com/prometheus/procfs/blob/v0.9.0/fs.go#L26-L33 https://github.com/prometheus/procfs/blob/v0.9.0/internal/fs/fs.go#L23-L24

This patch splits the implementation of "resource" into platform-specific files, and stubs out the NewSysSampler() on non-Linux platforms.

(cherry picked from commit ce332e1)

Commit 509cfa3 introduced the SysSampler,
which measures resource consumption. However, for this it depends on
prometheus' procfs. That package does not have build-tags but is a Linux-only
implementation, which (by default) attempts to access `/proc`;
https://github.com/prometheus/procfs/blob/v0.9.0/fs.go#L26-L33
https://github.com/prometheus/procfs/blob/v0.9.0/internal/fs/fs.go#L23-L24

This patch splits the implementation of "resource" into platform-specific
files, and stubs out the NewSysSampler() on non-Linux platforms.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ce332e1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the v0.12.1 milestone Jul 20, 2023
@thaJeztah thaJeztah marked this pull request as ready for review July 20, 2023 13:18
@thaJeztah thaJeztah requested review from crazy-max and jedevc July 20, 2023 13:18
@jedevc jedevc merged commit daf27d0 into moby:v0.12 Jul 20, 2023
@thaJeztah thaJeztah deleted the 0.12_backport_windows_no_proc branch July 20, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants