-
Notifications
You must be signed in to change notification settings - Fork 19
Cleanup service - move preserve parent and utxo cleanup from blockass… #114
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
base: main
Are you sure you want to change the base?
Conversation
…embly to cleanup service
|
🤖 Claude Code Review Status: Complete Current Review: Found 2 issues:
Architecture Summary: |
…o stu/cleanup-service
|
| } | ||
| } | ||
| } | ||
| }() |
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.
Status: Still present
The notification subscription goroutine does not respect context cancellation. If the service stops before the subscription channel closes, this goroutine will leak.
Analysis: The issue remains at lines 113-126 in Server.go. The goroutine needs a select statement to handle both ctx.Done() and the subscription channel to prevent leaking when the service stops.
| utxoStore utxo.Store, | ||
| blockchainClient blockchain.ClientI, | ||
| blockAssemblyClient blockassembly.ClientI, | ||
| blobStore blob.Store, |
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.
Status: Still present
The blobStore parameter is accepted in the New() constructor but never used anywhere in the service implementation. Since it is passed as nil from daemon_services.go, this parameter should be removed to keep the API clean.
Evidence:
- Stored in Server struct (line 43)
- Accepted by constructor (line 63)
- Passed as nil by caller in daemon_services.go (line 1132)
- Never referenced or used anywhere in the cleanup service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
| @@ -0,0 +1,15 @@ | |||
| package config | |||
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.
Why is this in a new config package and not the settings package?
| } | ||
|
|
||
| // Create the block assembly client for the Cleanup service | ||
| blockAssemblyClient, err := blockassembly.NewClient(ctx, createLogger(loggerBlockAssembly), appSettings) |
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.
Use GetBlockAssemblyClient()
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.
Should be called worker.go (snake case, small letters, not include the package name)
| ) | ||
|
|
||
| func initPrometheusMetrics() { | ||
| // Metrics are auto-registered via promauto |
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.
metrics should be registered in the initPrometheusMetrics function. Otherwise the metrics will be created on every single service that is run, regardless of whether the cleanup service is working or not. This creates a lot of noise and extra data/processing for the metrics server. We should follow the pattern as in the other services.
…embly to cleanup service