feat: createBid batching#394
Conversation
…to artem/batching-create-bid
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…to artem/batching-create-bid
| // Channel for receiving cluster reservation result. | ||
| clusterch <-chan runner.Result | ||
| // Channel for receiving bid creation transaction result. | ||
| bidch <-chan runner.Result |
There was a problem hiding this comment.
There's no runner.Result involved anymore - the channel type reflects the new reply mechanism directly.
| }) | ||
| replyCh := make(chan error, 1) | ||
| select { | ||
| case o.bidSubmitCh <- bidRequest{msg: msg, replyCh: replyCh}: |
There was a problem hiding this comment.
Since BidBatcher is owned by the bidengine.service, we communicate with it by the channel, in this case we can have concurrent orders and one bidBatcher.
Should be merged after #392
Testing
Batcher
While provider was stopped I created 10 deployments and started a provider. During the order catchup it created expected batch of bids:
Smart retry
I've changed a code and force first message in a batch to fail.
flush batch=1 → injecting test failure idx=0 → ERR message failed, retrying remainder remaining=0 (msg removed, nothing left to retry → done)
flush batch=2
→ WRN injecting test failure idx=0 → ERR remaining=2
→ WRN injecting test failure idx=0 → ERR remaining=1
→ WRN injecting test failure idx=0 → ERR remaining=0
(all 3 stripped one by one, each caller gets individual error)