-
Notifications
You must be signed in to change notification settings - Fork 12
Update cadence/flow-go/flow-go-sdk/flow-emulator dependencies
#738
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
Changes from all commits
749f5a7
3ee89c9
34e02f5
87cfcfc
184b665
77a41fb
d139439
b436747
366d28d
b0ee1d1
8978836
6d60018
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ import ( | |
| "github.com/onflow/flow-go/fvm/evm" | ||
| flowGo "github.com/onflow/flow-go/model/flow" | ||
| "github.com/onflow/flow-go/module/component" | ||
| "github.com/onflow/flow-go/module/irrecoverable" | ||
| flowMetrics "github.com/onflow/flow-go/module/metrics" | ||
| "github.com/onflow/flow-go/module/util" | ||
| gethTypes "github.com/onflow/go-ethereum/core/types" | ||
|
|
@@ -368,10 +369,29 @@ func (b *Bootstrap) StartMetricsServer(ctx context.Context) error { | |
| b.logger.Info().Msg("bootstrap starting metrics server") | ||
|
|
||
| b.metrics = flowMetrics.NewServer(b.logger, uint(b.config.MetricsPort)) | ||
| err := util.WaitClosed(ctx, b.metrics.Ready()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like metrics server is a component. why remove these?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good question! So the metrics server became a component in this commit: onflow/flow-go@4c8ac17. Which means that with: err := util.WaitClosed(ctx, b.metrics.Ready())The entire test suite would fail, due to indefinite blocking. The same goes for the shutdown of the metrics server: <-b.metrics.Done()I had to remove the above line. The flow-go commit I linked above, was intended to be used from this PR: #682. I am unsure as to how to proceed here..
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take a look today.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should do it I think: #741
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@janezpodhostnik That piece of code works like a charm 💯 Could you prepare that PR and merge on this one?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. merged!
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome! |
||
| if err != nil { | ||
|
|
||
| // this logic is needed since the metric server is a component. | ||
| // we need to start and stop it manually here. | ||
|
|
||
| ictx, errCh := irrecoverable.WithSignaler(ctx) | ||
| b.metrics.Start(ictx) | ||
| if err := util.WaitClosed(ctx, b.metrics.Ready()); err != nil { | ||
m-Peter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return fmt.Errorf("failed to start metrics server: %w", err) | ||
| } | ||
| select { | ||
| case err := <-errCh: | ||
| // there might be an error already if the startup failed | ||
| return err | ||
| default: | ||
| } | ||
|
|
||
| go func() { | ||
| err := <-errCh | ||
| if err != nil { | ||
| b.logger.Err(err).Msg("error in metrics server") | ||
| panic(err) | ||
| } | ||
| }() | ||
|
|
||
m-Peter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return nil | ||
| } | ||
|
|
@@ -380,8 +400,8 @@ func (b *Bootstrap) StopMetricsServer() { | |
| if b.metrics == nil { | ||
| return | ||
| } | ||
| b.logger.Warn().Msg("shutting down metrics server") | ||
| <-b.metrics.Done() | ||
| b.logger.Warn().Msg("shutting down metrics server") | ||
| } | ||
|
|
||
| func (b *Bootstrap) StartProfilerServer(_ context.Context) error { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.