-
Notifications
You must be signed in to change notification settings - Fork 61
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
refactor+fix trace server url initialization #502
refactor+fix trace server url initialization #502
Conversation
acca9c5
to
748d3f4
Compare
Some notes about the use of the |
3d77142
to
73bc2da
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.
It looks good to me and it works locally and in GitPod. Thanks for improvement! @paul-marechal, could you please answer my question.
7ed41a4
to
9c8bea5
Compare
PR is good for re-review/merging again! |
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.
I tested it locally (with default URL) and in GitPod where a custom URL via the TRACE_SERVER_URL environment variable is used. Both work well. Thanks for the contribution.
Both `TraceServerUrlProviderImpl` and `TraceViewerEnvironment` are riddled with concurrency issues. A lot of events happen asynchronously but the logic doesn't take this into account, leaving the application vulnerable to race conditions when trying to fetch the trace server url. Refactor by removing `TraceViewerEnvironment` and moving its functionality directly into `TraceServerUrlProviderImpl`, add logic to prevent race conditions. Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
eafb9a0
to
2c82c94
Compare
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
cb2dc07
to
93a0157
Compare
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
Ok I am ashamed of continuously removing your approvals but this wasn't just nitpicking. The value returned by Thanks for bearing with me! |
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.
now I found something :-) Could you please update it?
theia-extensions/viewer-prototype/src/browser/trace-server-url-provider-frontend-impl.ts
Outdated
Show resolved
Hide resolved
theia-extensions/viewer-prototype/src/browser/trace-server-url-provider-frontend-impl.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
2c51cac
to
5c42350
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.
The normalizeUrl() method change in one of the previous commits causes that it won't work in GitPod anymore. See comment and suggestion below.
theia-extensions/viewer-prototype/src/browser/trace-server-url-provider-frontend-impl.ts
Outdated
Show resolved
Hide resolved
Thank you all for working on this! 🌳 |
3a2fa21
to
c0e2390
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.
Looks good to me. Thanks for the contribution.
Both `TraceServerUrlProviderImpl` and `TraceViewerEnvironment` are riddled with concurrency issues. A lot of events happen asynchronously but the logic doesn't take this into account, leaving the application vulnerable to race conditions when trying to fetch the trace server url. Refactor by removing `TraceViewerEnvironment` and moving its functionality directly into `TraceServerUrlProviderImpl`, add logic to prevent race conditions. Signed-off-by: Paul Marechal <paul.marechal@ericsson.com>
Both
TraceServerUrlProviderImpl
andTraceViewerEnvironment
areriddled with concurrency issues. A lot of events happen asynchronously
but the logic doesn't take this into account, leaving the application
vulnerable to race conditions when trying to fetch the trace server url.
Refactor by removing
TraceViewerEnvironment
and moving itsfunctionality directly into
TraceServerUrlProviderImpl
, add logic toprevent race conditions.
Unfortunately I was forced to introduce a
LazyTspClient
which isimplemented as a proxy to a
TspClient
and defers all async methodcalls until
baseUrl
is asynchronously resolved. This only works becauseall
TspClient
methods are asynchronous.The proxy is a temporary measure which should buy you time until
you guys rework the frontend initialization sequence to make sure
everyone expects and handles the asynchronous steps.
Fixes #493
Closes #499