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: sales concurrency bug #537

Merged
merged 2 commits into from
Sep 5, 2023
Merged

fix: sales concurrency bug #537

merged 2 commits into from
Sep 5, 2023

Conversation

AuHau
Copy link
Member

@AuHau AuHau commented Aug 28, 2023

Closes #532.

Since the onSale callback can potentially be overridden (for example, like in testsales), I have decided to create a new onFilled function instead. This function is not public and should only be used to clear the futures of the Queue.

Other options include making the onSale function "private" or supporting multiple functions in hooks.

@AuHau AuHau requested review from markspanbroek and emizzle August 28, 2023 12:02
emizzle
emizzle previously approved these changes Aug 31, 2023
Copy link
Contributor

@emizzle emizzle left a comment

Choose a reason for hiding this comment

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

LGTM!
I think we can simply remove OnSale, as it's not really being used, and OnFilled is more accurate.

@emizzle emizzle mentioned this pull request Aug 31, 2023
@AuHau
Copy link
Member Author

AuHau commented Sep 5, 2023

I think we can simply remove OnSale, as it's not really being used, and OnFilled is more accurate.

The problem with replacing OnSale with OnFilled is that if OnFilled would be used by some external component (like tests for example) than it would potentially break the Sales module as currently the hooks allow only one hook to be used and if another is added than it replaces the original. And we use the OnFilled for unblocking the queue workers, so if tests would use it for some tests assertions then it would break the unblocking of the queue workers mechanism. I will add comment about it to the code and then merge it in the current form.

@AuHau AuHau merged commit ae89db1 into master Sep 5, 2023
@AuHau AuHau deleted the fix/sales-concurrency-bug branch September 5, 2023 14:47
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.

Amount of active Slots that host can host is limited to SlotQueue's maxWorkers (default 3)
2 participants