fix: register the time-series progress listener before the blocking call - #2066
Merged
Conversation
…eval The data-job listener was created and registered on the line after getTimeSeriesValues() returned, then removed in the finally block. Since that call became a blocking rpc in 1c16cce, the DATA_PROGRESS events the server fires for the job arrive while it is running - that is, before anything is listening - so they were computed, serialised, sent and dropped, and the task dialog never advanced during a retrieval that can take a while. Move the registration above the call. The existing finally block already removes it, and the listener only touches ClientTaskStatusSupport, so there is nothing else to reorder. The DATA_COMPLETE and DATA_FAILURE handlers stay commented out: 1c16cce removed the results and the exception from DataJobEvent deliberately, so there is nothing for them to record. Left alone for the same reason: the .isBackgroundTask mode that gates these events, whose removal that commit named as the next step but which is a larger change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D71LBYmQNf5J94wPqr81Jx
This file contains hidden or 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
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.
Follow-up to #2063, from looking into the commented-out handlers in
TimeSeriesDataJobListener.The commented-out code is fine — leave it
1c16cce796(2018-03-27, "simplify DataJobEvent:complete, getTimeSeriesValues() rpc blocks")deliberately removed the results and the exception from
DataJobEvent: "the COMPLETE and FAILUREevents no longer hold the results and the exception (instead managed by the invoking process of
the rpc call)".
DataJobEventtoday carries onlyeventType,progress,dataKey,dataIdString,vcDataJobID— there is nothing left for those two handlers to write, andrestoring them would not compile. No change here.
But that commit left the registration in the wrong place
It made
getTimeSeriesValues()blocking and disabled the polling loop, without moving thelistener registration:
So the one handler still live —
DATA_PROGRESS— could never fire:DataSetControllerImplfiresDATA_PROGRESSfrom five sites during the computation, with a real percentagevcDataJobID.isBackgroundTask(), which these jobs always are — the callers assert itTimeSeriesDataJobListenerconstruction in the codebase is that line, after the rpcPDEDataViewer.dataJobMessagefans out todataJobListenerListThe progress was computed server-side, serialised, shipped to the client and dropped on arrival.
The user got a task dialog that never advanced during exactly the long retrievals #2063 was
about — that reporter was pulling a time plot from a still-running simulation.
The fix
Move the two lines above the call. The existing
finallyalready removes the listener, and thelistener only touches
ClientTaskStatusSupport(itshashTablefield is dead now), so there isnothing else to reorder and no new threading concern.
Tests
One test added to
TimeSeriesDataRetrievalTaskTest: the stub context records whether thelistener was registered at the moment the retrieval ran. Checked against the old ordering — it
fails there and passes here, so it pins the ordering rather than just passing.
vcell-clientFast: 37 tests, 0 failures, 0 errors.Deliberately not included
That 2018 commit named "remove the .isBackgroundTask mode" as the next step, and it is the
switch gating these events. That is a larger change and a design call, so it is untouched here,
as are the stale commented block and the now-unused
hashTablefield on the listener.🤖 Generated with Claude Code
https://claude.ai/code/session_01D71LBYmQNf5J94wPqr81Jx