-
Notifications
You must be signed in to change notification settings - Fork 74
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
feat(daemon): Expose cancellation context in caplets #2079
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 tasks
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
from
February 15, 2024 08:07
7ad5bed
to
58dbd3a
Compare
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
5 times, most recently
from
February 16, 2024 04:38
fd7c24a
to
400a09e
Compare
12 tasks
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
2 times, most recently
from
February 21, 2024 06:02
2202b5f
to
e9c42be
Compare
rekmarks
changed the base branch from
master
to
rekmarks-mutually-exclusive-formula-graph-mutations
February 21, 2024 06:02
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
3 times, most recently
from
February 22, 2024 01:29
2a1889c
to
8b10d5f
Compare
rekmarks
force-pushed
the
rekmarks-mutually-exclusive-formula-graph-mutations
branch
2 times, most recently
from
February 22, 2024 01:38
afdfa21
to
c4f5572
Compare
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
from
February 22, 2024 01:39
8b10d5f
to
815f677
Compare
rekmarks
force-pushed
the
rekmarks-mutually-exclusive-formula-graph-mutations
branch
from
February 22, 2024 01:45
c4f5572
to
b2522bf
Compare
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
3 times, most recently
from
February 22, 2024 05:24
355e206
to
dc6f91b
Compare
rekmarks
force-pushed
the
rekmarks-mutually-exclusive-formula-graph-mutations
branch
from
February 22, 2024 16:18
d9c865c
to
fcd9093
Compare
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
from
February 22, 2024 16:23
dc6f91b
to
0affff1
Compare
Base automatically changed from
rekmarks-mutually-exclusive-formula-graph-mutations
to
master
February 22, 2024 18:36
Adds unit tests for using the cancellation context in both confined and unconfined plugins / caplets. Deletes some unused args and fixes some type issues discovered in the course of work. Also, adds docstrings to the Context interface in types.d.ts. In the course of implementation, a bug was discovered. The added tests only pass due to the addition of a delay that should not be necessary. The following applies the same to both the confined and unconfined cases. The tests are structured as follows: ``` 1 const result = E(host).evaluate( 2 'worker', 3 'E(caplet).awaitCancellation()', 4 ['caplet'], 5 ['context-consumer'], 6 ); 7 await E(host).cancel('context-consumer'); 8 t.is(await result, 'cancelled'); ``` The test endo.log reveals the cause: ``` Making make-unconfined:1f440... Making least-authority:abc51... Cancelled: * make-unconfined:1f440... Making eval:c9ae8... Making make-unconfined:1f440... ``` Despite receiving the `evaluate` request first and the cancellation request second, the host processes these requests in reverse order. The result is that the test hangs. As a temporary fix, a timeout is added on line 6. This bug will be fixed in a future commit.
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
from
February 22, 2024 18:38
0affff1
to
7be3356
Compare
rekmarks
commented
Feb 22, 2024
rekmarks
commented
Feb 22, 2024
kriskowal
approved these changes
Feb 22, 2024
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.
Please consider the questions. I do not need to review again.
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
from
February 22, 2024 19:24
9a81d03
to
d346078
Compare
Synchronizes the host's `cancel()` with the formula graph by awaiting the formula graph mutex in a new daemon method, `cancelValue()`. Modifies the mutex implementation to permit calling `enqueue()` without specifying function to call.
rekmarks
force-pushed
the
rekmarks-context-in-caplet
branch
from
February 22, 2024 19:36
d346078
to
8a52453
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates #2086
Exposes the
context
object to confined and unconfined caplets by passing it as a second argument to theirmake()
function.