-
Notifications
You must be signed in to change notification settings - Fork 993
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
Remove or guards some unwraps in stratum #2453
Conversation
I just complied and try this update, seems many rigs got dropped, only several were able to submit shares. The log repeats like below: |
self.handle_login(request.params, &mut workers_l[num]) | ||
} | ||
"submit" => { | ||
if let None = worker_stats_id { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't match
(here and below) looks cleaner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hashmap 👍 looks like it. I suspect cargo-clippy also agrees.
.position(|r| r.id == workers_l[num].id) | ||
.unwrap(); | ||
stratum_stats.worker_stats[worker_stats_id].last_seen = SystemTime::now(); | ||
.position(|r| r.id == workers_l[num].id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just ignore such worker? I'm trying to understand how we can get into this situation, don't see it so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial guessing has been that there is some miner (software, or class of user) that is fairly uncommon, and that manages to crash the stratum server silently. Truly crashing would allow pool operators to have the service autorestart. Or not crashing might hide the issue. So, maybe log this case loudly?
Related #2446 (awkward PR title, sorry) which also refactors a bit. I haven't yet compared the two PRs. @bladedoyle and others who'd want to try this, do: |
UPDATE: having compared, this PR is cleaner, while potentially excluding some clients from accessing api endpoints The difference with #2446 is with where we ignore a worker (via (is the integer vs string discussion relevant here?) |
@sesam
I lost the log, but have a screen shot here So it was the 'clean_workers' fonction caused this 'panic'. I tried to modify the code as what you did in the clean_workers: No panic anymore, but the number of tcp connection is keep growing, obviously the 'dead' workers can not be dropped and the inactive connections always remain there. |
Please copy the link to the browser, I found just click doesn't work at github :( |
Going to close this. It was an attempt at a small improvement but looks like our stratum server needs much more than small fixes. |
@ignopeverell Guessing it might be solved by combining @sesam and @hashmap's update, as what I post here at #2457. I am still running the test, but everything is fine till now, it has been running without problem for more than 1 hour with 100+ rigs mining. |
Has been running for 4 hours, the tcp connection grew from 300 to 1.5K, and keep increasing. So seems the 'dead' tcp connection still can not be cloesed properly. |
Attempts to fix #2421. Stratum will ignore several client requests until re-login but should not crash anymore.