-
Notifications
You must be signed in to change notification settings - Fork 23
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: Insert channel params before posting new order #2056
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3e2fe6b
to
76227bc
Compare
luckysori
reviewed
Feb 17, 2024
@luckysori I've addressed your remarks! Please have another look cd1cb10 |
luckysori
approved these changes
Feb 19, 2024
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.
LGTM. A couple of minor things. Thanks for fixing this bug!
da0c34c
to
afa3f39
Compare
… the coordinator I am not exactly sure why this is fixing the issue, but my assumption is the following. If we receive the order match (async via websockets) before the post_new_order http request has finished. We'd still hold an open connection and the write lock on the order. I presume this leads to the order match processing to fail because of Could not load order from db: cannot acquire database connection: timed out waiting for connection. But I am not sure why that would result into the processing of the order match running into a timeout when trying to get a connection. When the post_new_order finally finishes the lock is freed up. I guess afterwards the pool would return connections again but we are already stuck because we do not send the trade request anymore (since processing the match already failed) Additionally I had to remove the order_id check on the submit_order_change_notifier, since it could happen that we don't have the id yet if the order match is already processed before the http post new order request finished. IMHO that should be fine because we only ever have one active order anyways and we don't have to separate them. fixes #2055
afa3f39
to
bc1bcd8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am not exactly sure why this is fixing the issue, but my assumption is the following.
If we receive the order match (async via websockets) before the
post_new_order
http request has finished. We'd still hold an open connection and the write lock on the order.I presume this leads to the order match processing to fail because of
Could not load order from db: cannot acquire database connection: timed out waiting for connection
. But I am not sure why that would result into the processing of the order match running into a timeout when trying to get a connection.When the
post_new_order
finally finishes the lock is freed up. I guess afterwards the pool would return connections again but we are already stuck because we do not send the trade request anymore (since processing the match already failed)Additionally I had to remove the order_id check on
the submit_order_change_notifier
, since it could happen that we don't have the id yet if the order match is already processed before the http post new order request finished. IMHO that should be fine because we only ever have one active order anyways and we don't have to separate them.fixes #2055