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

Double count of jobs #337

Closed
D4rk4 opened this issue May 11, 2021 · 14 comments
Closed

Double count of jobs #337

D4rk4 opened this issue May 11, 2021 · 14 comments

Comments

@D4rk4
Copy link

D4rk4 commented May 11, 2021

$ plotman status
plot id k tmp dst wall phase tmp pid stat mem user sys io
fc950a1b 32 /srv/chia/fast /srv/chia/dest 6:58 3:1 236G 4176527 SLP 2.6M 0s 0s 0s
fc950a1b 32 /srv/chia/fast /srv/chia/dest 6:58 3:1 236G 4176528 DSK 18.4G 6:01 0:07 1:23
a9f3ea7a 32 /srv/chia/fast /srv/chia/dest 9:40 4:0 176G 1317240 SLP 2.6M 0s 0s 0s
a9f3ea7a 32 /srv/chia/fast /srv/chia/dest 9:40 4:0 176G 1317241 RUN 17.7G 8:16 0:13 4:19

Chia from deb package:

$ dpkg -l | grep chia; which chia; ls -lash which chia
ii chia-blockchain 1.1.4 amd64 GUI for Chia Blockchain
/usr/local/bin/chia
512 lrwxrwxrwx 1 root staff 64 мая 8 17:57 /usr/local/bin/chia -> /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon/chia

@D4rk4
Copy link
Author

D4rk4 commented May 11, 2021

#330

@altendky
Copy link
Collaborator

What is the output of ps aux | grep -P '(plots create|plotman)'? Also, how did you install plotman? Specifically @main or @development?

@jujuforce
Copy link

I have the exact same issue, I tired the command @altendky : it does return the job twice :(

@D4rk4
Copy link
Author

D4rk4 commented May 11, 2021

ps aux | grep -P '(plots create|plotman)'

$ ps aux | grep -P '(plots create|plotman)' | grep -v grep
dark       31180  0.0  0.0   2536   612 ?        SNs  15:17   0:00 chia plots create -k 32 -r 6 -u 128 -b 8000 -t /srv/chia/fast -d /srv/chia/dest -f 82eba39f6428ca342fa0ce685f65f2dddb7441eeba1e23b861a96f57e8484b1500c69240a47fa4d2988aed32a8368b50 -p 9790ca1e0435c18839bdad5b0d4ef8cff762ab574549bcdd6852a83aa7ed9ad6ce79924dcacad1f77b60ad7ca654fa45
dark       31181  236  5.6 8953160 3742448 ?     SNLl 15:17 100:23 chia plots create -k 32 -r 6 -u 128 -b 8000 -t /srv/chia/fast -d /srv/chia/dest -f 82eba39f6428ca342fa0ce685f65f2dddb7441eeba1e23b861a96f57e8484b1500c69240a47fa4d2988aed32a8368b50 -p 9790ca1e0435c18839bdad5b0d4ef8cff762ab574549bcdd6852a83aa7ed9ad6ce79924dcacad1f77b60ad7ca654fa45
dark      229569  3.3  0.0  43116 24916 pts/0    S+   15:49   0:20 /usr/bin/python3 /home/dark/.local/bin/plotman interactive
dark      276992  0.0  0.0   2536   620 ?        SNs  15:59   0:00 chia plots create -k 32 -r 6 -u 128 -b 8000 -t /srv/chia/ext -d /srv/chia/dest -f 82eba39f6428ca342fa0ce685f65f2dddb7441eeba1e23b861a96f57e8484b1500c69240a47fa4d2988aed32a8368b50 -p 9790ca1e0435c18839bdad5b0d4ef8cff762ab574549bcdd6852a83aa7ed9ad6ce79924dcacad1f77b60ad7ca654fa45
dark      276993 67.7  0.2 706824 158988 ?       SNLl 15:59   0:19 chia plots create -k 32 -r 6 -u 128 -b 8000 -t /srv/chia/ext -d /srv/chia/dest -f 82eba39f6428ca342fa0ce685f65f2dddb7441eeba1e23b861a96f57e8484b1500c69240a47fa4d2988aed32a8368b50 -p 9790ca1e0435c18839bdad5b0d4ef8cff762ab574549bcdd6852a83aa7ed9ad6ce79924dcacad1f77b60ad7ca654fa45

It's @development branch

@altendky
Copy link
Collaborator

Thanks. I'll try to figure this out tonight. I do see #330 but would like to understand this a bit better. I'm a bit confused why this is just popping up now.

@jujuforce
Copy link

jujuforce commented May 12, 2021

I got a fix on my computer but I won't create a pull request for this as this is a hack at best.
It is adding this filter in the get_running_jobs function :

proc.cpu_times().user == 0.0

It looks counter intuitive, but only the proc with this attributes at 0.0 does have open_files associated with it. I am not a linux nor python expert so I have no idea why ...

It works here but I guess that will not be the case on computer not affected by the issue.
A cleaner way would be to use the ppid() of the proc, but I can't make it work atm.

Cheers.

@lexzz
Copy link

lexzz commented May 12, 2021

I'm seeing the same issue on the development branch

@rafaelsteil
Copy link
Contributor

I got a fix on my computer but I won't create a pull request for this as this is a hack at best.
It is adding this filter in the get_running_jobs function :

proc.cpu_times().user == 0.0

It looks counter intuitive, but only the proc with this attributes at 0.0 does have open_files associated with it. I am not a linux nor python expert so I have no idea why ...

I'd say it was more of a coincidence than anything else.

It works here but I guess that will not be the case on computer not affected by the issue.
A cleaner way would be to use the ppid() of the proc, but I can't make it work atm.

Relying on the parent pid can get tricky very quickly and doesn't indicate anything bad or good per se. A job started by plotman plot will have it's pid as parent as long as plotman plot is running. If you stop the plotter (a perfect valid scenario) the jobs will then return 1 as their parent PID.

@rafaelsteil
Copy link
Contributor

$ plotman status
plot id k tmp dst wall phase tmp pid stat mem user sys io
fc950a1b 32 /srv/chia/fast /srv/chia/dest 6:58 3:1 236G 4176527 SLP 2.6M 0s 0s 0s
fc950a1b 32 /srv/chia/fast /srv/chia/dest 6:58 3:1 236G 4176528 DSK 18.4G 6:01 0:07 1:23
a9f3ea7a 32 /srv/chia/fast /srv/chia/dest 9:40 4:0 176G 1317240 SLP 2.6M 0s 0s 0s
a9f3ea7a 32 /srv/chia/fast /srv/chia/dest 9:40 4:0 176G 1317241 RUN 17.7G 8:16 0:13 4:19

@D4rk4 One thing that I noticed is that, despite that some columns are the same, other's aren't, which is curious. Can you confirm that when you saw this issue you actually had only two "real" jobs instead of 4?

@D4rk4
Copy link
Author

D4rk4 commented May 13, 2021

@rafaelsteil it's 2 jobs, correct job info displayed in the second row of each plot ID

@altendky
Copy link
Collaborator

If you could try out #418, that'd be great. Follow the regular readme installation but use git+https://github.com/altendky/plotman@skip_matching_plot_process_parents as the url.

@jujuforce
Copy link

@altendky Works well for me, found a minor bug though, some temporary file (2-3 each time) are not removed after a plotman kill.

@altendky
Copy link
Collaborator

@juliencampy yeah, the plotter doesn't keep all the files open all the time I think and that's how we detect. There's some improvement to be done there for sure.

@D4rk4
Copy link
Author

D4rk4 commented May 15, 2021

Work fine for me with pip install --force-reinstall git+https://github.com/ericaltendorf/plotman@development

@D4rk4 D4rk4 closed this as completed May 15, 2021
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

No branches or pull requests

5 participants