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

sidecar: clean old shims for orders in current batch #342

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

positiveblue
Copy link
Contributor

Quick (dirty) fix to ensure that we do not end up in an endless loop of batch rejections. One side effect is that we pollute the logs a bit more (issue #327).

#341 will fix this properly, by ensuring that shim creation after matching is atomic. Meanwhile this unblocks some of our traders.

Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

LGTM, nice quick fix!

@@ -601,6 +601,13 @@ func (a *SidecarAcceptor) matchPrepare(pendingBatch *order.Batch,
sdcrLog.Infof("Received PrepareMsg for batch=%x, num_orders=%v",
batch.ID[:], len(batch.MatchedOrders))

// Ensure that we do not have any registered shims for the orders
// in this batch. This is not supposed to happen but we have a bug.
if err = a.removeShims(batch); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps link to the PR where this will be fixed for good?
Also add a comment that removeShims will only return an error for serious problems (for example not being able to read orders from disk) and not if there is no pending shim (only a warning will be logged but no error returned).

@positiveblue positiveblue merged commit 1ec8849 into master Feb 25, 2022
@guggero guggero deleted the clean-old-order-shims branch May 5, 2022 15:25
positiveblue pushed a commit to positiveblue/pool that referenced this pull request Oct 11, 2022
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.

2 participants