-
Notifications
You must be signed in to change notification settings - Fork 61
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
WIP: retry keystone on failure #15
Closed
Closed
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
service/popm/popm.go
Outdated
@@ -50,6 +50,33 @@ func init() { | |||
loggo.ConfigureLoggers(logLevel) | |||
} | |||
|
|||
type CircularFifo struct { | |||
buf chan hemi.L2Keystone | |||
mtx sync.Mutex |
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.
don't need this mutex
ClaytonNorthey92
force-pushed
the
clayton/popm-keystone-retry
branch
from
February 28, 2024 22:41
0c46eaf
to
361f695
Compare
* if a keystone fails to mine, retry * check if the keystone has already been mined * allow a queue of 10 keystones, dropping the oldest if full and a new one comes in
ClaytonNorthey92
force-pushed
the
clayton/popm-keystone-retry
branch
from
February 28, 2024 22:43
361f695
to
c1719fa
Compare
ClaytonNorthey92
changed the title
retry keystone on failure
WIP: retry keystone on failure
Feb 29, 2024
|
||
func (r *CircularFifo) MineEach(cb func(ks hemi.L2Keystone) error) { | ||
r.mtx.Lock() | ||
copies := slices.Clone(r.buf) |
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.
do oldest first
Closing until ready for review |
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.
Summary
allowing keystone retries with a fifo queue
Changes
if a keystone fails to mine, retry
check if the keystone has already been mined
allow a queue of 10 keystones, dropping the oldest if full and a new one comes in
fixes #7