-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[ftr] log async init errors right when they happen #11898
Conversation
f45a1f1
to
1fcf774
Compare
1fcf774
to
6f2f274
Compare
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! 📗
@@ -35,16 +37,15 @@ export class ProviderCollection { | |||
await instance.init(); | |||
} | |||
} catch (err) { | |||
asyncInitErrors.push(err); | |||
this._log.warning('Failure loading service %j', name); | |||
this._log.error(err); |
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.
👍
@@ -2,7 +2,8 @@ import { loadTracer } from '../load_tracer'; | |||
import { createAsyncInstance, isAsyncInstance } from './async_instance'; | |||
|
|||
export class ProviderCollection { | |||
constructor(providers) { | |||
constructor(log, providers) { | |||
this._log = log; | |||
this._instances = new Map(); | |||
this._providers = providers; |
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.
the _private naming thing is a thing we do? is the point just to indicate to others that this is meant to be used in a private way?
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.
Yep
(cherry picked from commit 192b2ea)
5.5/5.x: 595294e |
Rather than just throwing the first error that happens during async provider loading, log all errors as they occur and then throw an error at the end mentioning all of the services that failed, by name.