-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add hic aborting and fix remoteAbort signal propagation #1783
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1783 +/- ##
==========================================
- Coverage 58.66% 58.63% -0.03%
==========================================
Files 457 457
Lines 21193 21206 +13
Branches 5016 5017 +1
==========================================
+ Hits 12432 12434 +2
- Misses 8451 8462 +11
Partials 310 310
Continue to review full report at Codecov.
|
30d8e4d
to
be2e3a8
Compare
This may have introduced side effect seen here #1785 |
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
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.
👍
f6d0bcd
to
5409f2f
Compare
Note that the effect seen in #1785 is visible even if the globalRangeCache is disabled with
|
Probably we need to look at AbortablePromiseCache, BAI uses it as an "abortable memoize" and something might be causing it to get purged |
This PR is probably good to go but GMOD/abortable-promise-cache#12 should get bumped also |
@@ -89,6 +94,11 @@ export default class HicRenderer extends ServerSideRendererType { | |||
baseColor, | |||
]) | |||
ctx.fillRect((bin1 - offset) * w, (bin2 - offset) * w, w, w) | |||
if (+Date.now() - start > 400) { |
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 date is being used to count for the timeout?
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.
ya, the idea is to check every 400ms for whether an abort has arrived. The hic track can on take up to 5s to do a complete render so it intermittently checks to see if it should cancel
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 real trickyness was making sure the abort signal was passed through to the backend. I'm not sure if I have added enough tests to ensure this works but there are a couple added in the BaseRpcDriver...
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.
gotcha. Now the abort signal is getting passed as a prop?
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, actually every renderer will get a signal prop it just depends on whether they use it
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 would be valuable to use the lessons from this PR to spread it throughout the codebase
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 see, I see.
@rbuels any thoughts on this? would be good to merge with the abortable-promise-cache PR(s) too |
there could be more advanced tests because this technically does not test remote abort but I wasn't sure how to instrument that yet |
This fixes a bug in the remoteAbort call where the signalId was not being passed at all (it was calling {...1} which is just {}, the signal wasn't given a name on the object)
Then it adds a couple points in the hic code where it checks the abort signal, using a timeout to yield to the webworker to process the abortsignal RPC calls