-
Notifications
You must be signed in to change notification settings - Fork 115
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
Simplify process FindAndInstrument synchronization #1579
Conversation
instr := appolly.New(ctx, ctxInfo, config) | ||
if err := instr.FindAndInstrument(&wg); err != nil { |
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.
This change avoids sharing the ownership of a critical synchronization mechanism between different components.
The usual convention in Go is expose a simpler synchronization mechanism, such as returning a close channel.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1579 +/- ##
==========================================
+ Coverage 71.20% 71.23% +0.02%
==========================================
Files 197 197
Lines 19754 19750 -4
==========================================
+ Hits 14066 14068 +2
+ Misses 5006 5002 -4
+ Partials 682 680 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ctx context.Context | ||
cancel func() | ||
} | ||
contexts := map[uint64]cancelCtx{} |
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.
Didn't saw the utility of storing all the contexts and explicitly cancelling them after the parent context is cancelled.
If the parent context its Done, all the child contexts are Done in cascade.
@@ -95,7 +87,7 @@ func (i *Instrumenter) FindAndInstrument(wg *sync.WaitGroup) error { | |||
} | |||
}() | |||
// TODO: wait until all the resources have been freed/unmounted |
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.
Not sure if this already happens. I will try to check/fix the RingbufForwarder in a future PR.
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.
LGTM - I guess my only ""concern"" is that we aren't leaving anything behind - or if we are, that we understand why that happens and are fine with that.
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.
LGTM 🚀 :)
To be merged after 2.0 is released