Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Update/clarify doc comments

Co-authored-by: Jordan Schalm <[email protected]>
  • Loading branch information
tim-barry and jordanschalm authored Dec 16, 2024
1 parent 75a6b28 commit c7a85f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion engine/execution/ingestion/uploader/uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ type AsyncUploader struct {
queue chan *execution.ComputationResult
cm *component.ComponentManager
component.Component
// TODO Replace fifoqueue with channel, and make Upload() blocking
}

// UploadWorker implements a component worker which asynchronously uploads computation results
Expand Down Expand Up @@ -108,6 +107,8 @@ func (a *AsyncUploader) UploadTask(ctx context.Context, computationResult *execu
return retry.RetryableError(err)
})

// We only log upload errors here because the errors originate from an external cloud provider
// and the upload success is not critical to correct continued operation of the node
if err != nil {
a.log.Error().Err(err).
Hex("block_id", logging.Entity(computationResult.ExecutableBlock)).
Expand Down
6 changes: 3 additions & 3 deletions module/component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var ErrComponentShutdown = fmt.Errorf("component has already shut down")
type Component interface {
module.Startable
// Ready returns a ready channel that is closed once startup has completed.
// Unlike the previous ReadyDoneAware interface, it has no effect on the state of the component,
// Unlike the previous [module.ReadyDoneAware] interface, it has no effect on the state of the component,
// and only exposes information about the component's state.
// To start the component, instead use the Start() method.
// Note that the ready channel may never close if errors are encountered during startup,
Expand All @@ -32,10 +32,10 @@ type Component interface {
Ready() <-chan struct{}

// Done returns a done channel that is closed once shutdown has completed.
// Unlike the previous ReadyDoneAware interface, it has no effect on the state of the component,
// Unlike the previous [module.ReadyDoneAware] interface, it has no effect on the state of the component,
// and only exposes information about the component's state.
// To shutdown the component, instead cancel the context that was passed to Start().
// Note that the done channel should be closed even if errors are encountered during shutdown.
// Implementations must close the done channel even if errors are encountered during shutdown.
// This should be an idempotent method.
Done() <-chan struct{}
}
Expand Down

0 comments on commit c7a85f7

Please sign in to comment.