-
Notifications
You must be signed in to change notification settings - Fork 148
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
✨ [RUM-252] optimistic worker creation #2377
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Codecov Report
@@ Coverage Diff @@
## main #2377 +/- ##
==========================================
- Coverage 93.96% 93.95% -0.01%
==========================================
Files 210 210
Lines 6242 6237 -5
Branches 1387 1386 -1
==========================================
- Hits 5865 5860 -5
Misses 377 377
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
00df35f
to
1aa681b
Compare
/to-staging |
🚂 Branch Integration: starting soon, merge in < 8m commit 1aa681b58b will soon be integrated into staging-32. This build is going to start soon! (estimated merge in less than 8m) you can cancel this operation by commenting your pull request with |
🚂 Branch Integration: this commit was successfully integrated Commit 1aa681b58b has been merged into staging-32 in merge commit 1b59f70efd. Check out the triggered pipeline on Gitlab 🦊 |
createDeflateWorkerImpl = createDeflateWorker | ||
) { | ||
if (state.status === DeflateWorkerStatus.Nil) { | ||
doStartDeflateWorker(configuration, createDeflateWorkerImpl) |
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.
💭 Maybe add a comment that doStartDeflateWorker
can change state.status? I was wondering why it had been taken out of the else
statement.
Also rename `getReplayStats` to `getReplayStatsImpl` to be less confusing with the method name
67977f2
to
2801b02
Compare
Motivation
The Deflate Worker initialization is asynchronous: we instantiate the Worker, we send a first
message and wait for a response to make sure the communication works.
The recorder has been designed to wait until this initialization succeeds before actually starting
to record. This has one major benefit for Replay: no
has_replay: true
flag is set in case theWorker initialization fails. If it was set, a link leading to an unknown replay would be displayed
in the Datadog App.
Because we want to use the Deflate Worker in other places, this asynchronous behavior is a bit
inconvenient as it forces the SDK initialization to be asynchronous too, for little benefit because
the worker initialization should succeeds in most case and we don't have the Replay constraint.
Changes
Make the worker start "optimistic", so the deflate Worker instance is returned synchronously.
Make sure the
has_replay
(and replay stats) is present only if the worker was correctlyinitialized.
Testing
I have gone over the contributing documentation.