-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Set inited flag _after_ TermInfoDriver initialisation completes #18318
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
Conversation
|
approve |
|
Looks racy -- more on-demand initialization, and without data dependency.. |
|
Generic fix is to put all the state behind one pointer, that goes from null to non-null, once. |
|
@jaykrell how is it racy? it's behind a lock... |
is racy if |
In the original code, an exception on initialisation may fail to fully initialise, but will leave the class in an initialised state (since
From what I can see, all reads and writes to the uninitialised class will be gated at the lock until the class is initialised. After I did consider refactoring the class, but I think that would be a separate issue given the greater surface area. |
|
I think it's fine for the issue @nagytech is trying to solve. I agree that refactoring is a separate effort. |
|
The code is racy, and fails as a result, and the fix is to keep it racy, just less so? Is that right? |
In general, yes. But, more specifically I would say that there are two distinct behaviours here:
|
|
@monojenkins build failed |
|
@monojenkins backport 2019-12 |
…etes (#18329) [2019-12] Set inited flag _after_ TermInfoDriver initialisation completes This flag was causing issues when accessing console properties on concurrent threads during TermInfoDriver initialisation. Fixes #18317 Backport of #18318. /cc @steveisok @nagytech
This flag was causing issues when accessing console properties on concurrent threads during TermInfoDriver initialisation.
Fixes #18317