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

Active referrals counts increase only after the decrease active referrals count delay finished between 2 different (non-extended) mining sessions. #47

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

ice-myles
Copy link
Contributor

Increment t1/t2 active counts are done by processors. Decrement is detected by miner.

Miner handles batches of users, so the delay between mine() iteration start and decrementing user's active_t1_referrals/active_t2_referrals that was detected by didReferralJustStopMining function can create the situation,
when t1/t2 active count from previous mining session wasn't decremented, but has been already incremented for the new mining session. It happens only when user's session was finished, and then he started new session (not extended). As result t0 can have +1 obsolete t1_active_count/t2_active_count value.

To resolve this we need to return 409 duplicate error while t1/t2 referral count from previous session wasn't decreased. On production it can affect up to 9-10 seconds.

…rals count delay finished between 2 different (non-extended) mining sessions.
@ice-myles ice-myles added the bug Something isn't working label Dec 10, 2023
@ice-myles ice-myles self-assigned this Dec 10, 2023
@ice-myles ice-myles marked this pull request as ready for review December 11, 2023 14:14
@ice-myles ice-myles requested a review from a team as a code owner December 11, 2023 14:14
@ice-ares ice-ares merged commit 9e26c52 into master Dec 11, 2023
12 checks passed
@ice-ares ice-ares deleted the bugfix/increment-decrement-active-referrals-async branch December 11, 2023 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants