-
Notifications
You must be signed in to change notification settings - Fork 70
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(manager): resume block production right when skew < max skew #1252
Conversation
block/produce.go
Outdated
@@ -82,7 +82,7 @@ func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int) | |||
return nil | |||
case bytesProducedC <- bytesProducedN: | |||
default: | |||
evt := &events.DataHealthStatus{Error: fmt.Errorf("bytes produced channel is full: %w", gerrc.ErrResourceExhausted)} | |||
evt := &events.DataHealthStatus{Error: fmt.Errorf("Block production paused. Time between last block produced and last block submitted higher than max skew time %s: %w", m.Conf.MaxSkewTime, gerrc.ErrResourceExhausted)} |
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.
probably worth also putting here the last block subimtted time
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.
done
block/submit.go
Outdated
pendingBytes.Store(pending) | ||
ticker.Reset(maxBatchSubmitTime) |
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.
I don't understand this. can you please explain? thanks
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.
moved after loop and documented.
pending = uint64(unsubmittedBlocksBytes()) //nolint:gosec // bytes size is always positive | ||
logger.Info("Submitted a batch to both sub-layers.", "n bytes consumed from pending", nConsumed, "pending after", pending) // TODO: debug level | ||
pending = uint64(unsubmittedBlocksBytes()) //nolint:gosec // bytes size is always positive | ||
if batchSkewTime() < maxSkewTime { |
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.
can u elaborate on the use of this if
?
why not call trigger.Nudge()
after submission loop finished as before?
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.
if it is called after the loop, the block production wont be restarted until all pending batches, that have been created before stopping block production, are submitted to SL. this way block production will be restarted after the skew time condition is met without having to wait.
PR Standards
Opening a pull request should be able to meet the following requirements
--
PR naming convention: https://hackmd.io/@nZpxHZ0CT7O5ngTp0TP9mg/HJP_jrm7A
Close #XXX
<-- Briefly describe the content of this pull request -->
For Author:
godoc
commentsFor Reviewer:
After reviewer approval: