dspinellis / dspinellis/pmonitor

Progress for the same file read by different processes wrong

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
192
Forks
19
PR merge metrics
No merged PRs in 30d

Description

When reading the same file with multiple processes the output repeats the progress for the file in a strange way.

Sample output:
```text
$ pmonitor -i 1 -f /mnt/work/entries.txt
/mnt/work/entries.txt 45.78%
/mnt/work/entries.txt 58.62%
/mnt/work/entries.txt 0.00%
/mnt/work/entries.txt 45.79% ETA 9:01:08
/mnt/work/entries.txt 58.64% ETA 0:00:09
/mnt/work/entries.txt 0.00% ETA 0:00:09
/mnt/work/entries.txt 45.79% ETA 8:00:59
/mnt/work/entries.txt 58.66% ETA 0:00:12
/mnt/work/entries.txt 0.00% ETA 0:00:12
/mnt/work/entries.txt 45.80% ETA 7:12:50
/mnt/work/entries.txt 58.67% ETA 0:00:19
/mnt/work/entries.txt 0.00% ETA 0:00:19
```

I'd expect the thrid entry to be without an ETA (or if it really was at the beginning to have a quite high one)

Raw output from lsof:
```text
$ LANG=C LC_ALL=C lsof -w -o0 -o -- /mnt/work/entries.txt | grep entries; sleep 1; LANG=C LC_ALL=C lsof -w -o0 -o -- /mnt/work/entries.txt | grep entries

pigz 20241 user 3r REG 0,56 0t2528116736 6196851 /mnt/work/entries.txt
brotli 22412 user 3r REG 0,56 0t3430154240 6196851 /mnt/work/entries.txt
mc 23499 user 9r REG 0,56 0t8192 6196851 /mnt/work/entries.txt

pigz 20241 user 3r REG 0,56 0t2528378880 6196851 /mnt/work/entries.txt
brotli 22412 user 3r REG 0,56 0t3431202816 6196851 /mnt/work/entries.txt
mc 23499 user 9r REG 0,56 0t8192 6196851 /mnt/work/entries.txt
```

The file is 5233358936 bytes.

For process 23499 there should be no ETA, the other processes should show appropriate ETAs, which I doubt for pigz (10318 seconds from the lsof output) and brotli (4991 seconds from lsof output).

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Reproduce the issue with the pmonitor command shown and compare its per-process progress and ETA with the lsof readings; done means the shared file produces distinct process entries, no ETA for the idle mc process, and appropriate ETAs for active processes.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, shell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.