Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix location of Open Files in tree #144

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

adrianreber
Copy link
Member

Without this patch the output used to look something like this

│   └── [1]  bash
│       ├── Environment variables
│       ├── [8]  /usr/bin/coreutils
│       │   ├── Environment variables
│       │   └── Open files
│       │       └── [root]  /
│       ├── [7]  /usr/bin/python3
│       │   ├── Environment variables
│       │   ├── Open files
│       │   │   └── [root]  /
│       │   └── Open sockets
│       │       └── [TCP (LISTEN)]  0.0.0.0:8088 -> 0.0.0.0:0 (↑ 16.0 KB ↓ 128.0 KB)
│       └── Open files
│           └── [root]  /

Which is wrong as the list of open files (and sockets) for the first
process is after the child processes. With this change the order is now
correct:

│   └── [1]  bash
│       ├── Environment variables
│       ├── Open files
│       │   └── [root]  /
│       ├── [7]  /usr/bin/python3
│       │   ├── Environment variables
│       │   ├── Open files
│       │   │   └── [root]  /
│       │   └── Open sockets
│       │       └── [TCP (LISTEN)]  0.0.0.0:8088 -> 0.0.0.0:0 (↑ 16.0 KB ↓ 128.0 KB)
│       └── [8]  /usr/bin/coreutils
│           ├── Environment variables
│           └── Open files
│               └── [root]  /

Each process has its own "Open files" and "Open sockets". It was always
correct for "Environment variables".

@codecov-commenter
Copy link

codecov-commenter commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 82.22222% with 8 lines in your changes missing coverage. Please review.

Project coverage is 81.51%. Comparing base (3fcc128) to head (b2f5b23).

Files with missing lines Patch % Lines
internal/tree.go 82.22% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #144   +/-   ##
=======================================
  Coverage   81.50%   81.51%           
=======================================
  Files          11       11           
  Lines        1060     1082   +22     
=======================================
+ Hits          864      882   +18     
- Misses        126      128    +2     
- Partials       70       72    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Oct 15, 2024

Test Results

60 tests  ±0   60 ✅ ±0   1s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit b2f5b23. ± Comparison against base commit 3fcc128.

♻️ This comment has been updated with latest results.

Signed-off-by: Adrian Reber <[email protected]>
Without this patch the output used to look something like this

│   └── [1]  bash
│       ├── Environment variables
│       ├── [8]  /usr/bin/coreutils
│       │   ├── Environment variables
│       │   └── Open files
│       │       └── [root]  /
│       ├── [7]  /usr/bin/python3
│       │   ├── Environment variables
│       │   ├── Open files
│       │   │   └── [root]  /
│       │   └── Open sockets
│       │       └── [TCP (LISTEN)]  0.0.0.0:8088 -> 0.0.0.0:0 (↑ 16.0 KB ↓ 128.0 KB)
│       └── Open files
│           └── [root]  /

Which is wrong as the list of open files (and sockets) for the first
process is after the child processes. With this change the order is now
correct:

│   └── [1]  bash
│       ├── Environment variables
│       ├── Open files
│       │   └── [root]  /
│       ├── [7]  /usr/bin/python3
│       │   ├── Environment variables
│       │   ├── Open files
│       │   │   └── [root]  /
│       │   └── Open sockets
│       │       └── [TCP (LISTEN)]  0.0.0.0:8088 -> 0.0.0.0:0 (↑ 16.0 KB ↓ 128.0 KB)
│       └── [8]  /usr/bin/coreutils
│           ├── Environment variables
│           └── Open files
│               └── [root]  /

Each process has its own "Open files" and "Open sockets". It was always
correct for "Environment variables".

Signed-off-by: Adrian Reber <[email protected]>
Copy link
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rst0git rst0git merged commit 35c258e into checkpoint-restore:main Oct 15, 2024
10 checks passed
@adrianreber adrianreber deleted the 2024-10-15-fix-tree branch October 16, 2024 06:26
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