opentelemetry-lambda
opentelemetry-lambda copied to clipboard
Fix race on Collector.Start() loosing error info
When the inner collector (go.opentelemetry.io/collector/service) Run() call fails (likely due to a bad config file) the lambda collector wrapper would likely loose the actual error information and report just the unexpected collector state (CLOSED) back to the caller. This PR makes the collector wrapper's Start() method race-free, so that the actual error information is not lost.
Another improvement is related to the main() procedure - before this PR the main loop wouldn't handle situations when the inner collector exits before the SHUTDOWN event.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: iximiuz / name: Ivan Velichko (90898ef4c330f4792b0aa11db4a7566dd1a9d0e7)
@Aneurysm9 could you please help take a look at this? I remember last time we edited these files in #194 we were burned pretty bad before a release until we fixed in #207 😓 Please let me know what you think of this change!
Kind reminder that this PR is still awaiting its review 😇
I think this PR will not cause the same issues that #194 did. It does not hang the initialization until the end of svc.Run() like that one did. I will try to run this through some tests today, but the approach and code seem sound to me.
Thank you @Aneurysm9! I defer to you to merge if you think it looks good 🙂
Is this still a problem? This is a pretty old PR. I'm inclined to close it unless you want to revisit/rebase on main.
@tylerbenson feel free to close it. I won't have time to check if the issue remains, and we don't use this code in prod now.