You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/08/22 00:15:02 UTC

[I] Reconfiguration service leaks its engine callback past unsubscribeAll [texera]

aglinxinyuan opened a new issue, #7822:
URL: https://github.com/apache/texera/issues/7822

   ### Describe the bug
   
   `ExecutionReconfigurationService.registerWorkerCompletionCallback` (`amber/src/main/scala/org/apache/texera/web/service/ExecutionReconfigurationService.scala`, around line 117) calls `client.registerCallback[UpdateExecutorCompleted](...)` in statement position and **discards the returned `Disposable`**, so the engine callback outlives the service.
   
   It is the only such call site in `org.apache.texera.web.service` that does not wrap the result in `addSubscription`:
   
   | File | `registerCallback` sites | Wrapped |
   |---|---|---|
   | `ExecutionStatsService.scala` | 5 | yes |
   | `ExecutionResultService.scala` | 3 | yes |
   | `ExecutionConsoleService.scala` | 2 | yes |
   | `ExecutionRuntimeService.scala` | 1 | yes |
   | `ExecutionReconfigurationService.scala` | 1 | **no** |
   
   `AmberClient.registerCallback` does return the `Disposable` from its `observable.subscribe(...)` (`AmberClient.scala:116-152`), so there is a handle to keep.
   
   The teardown path is live in production: `WorkflowExecutionService.unsubscribeAll` (`WorkflowExecutionService.scala:185`) calls `executionReconfigurationService.unsubscribeAll()`, which releases every *other* subscription but not this one.
   
   And `client.shutdown()` is not an alternative release — it flips `isActive` and poison-pills the `ClientActor`, but never touches `registeredObservables` (written only in `registerCallback`, never cleared). So the `PublishSubject` chain keeps the subscriber closure, and through it the service, its `ExecutionStateStore` and its `Workflow`, alive for as long as the `AmberClient` is reachable — which `WorkflowExecutionService.client` ensures.
   
   This was found during coverage work (#7692), which deliberately recorded "wrap the discarded `Disposable` in `addSubscription`" as a *surviving* mutation so a fix would not be blocked by a test asserting the leak.
   
   ### How to reproduce?
   
   Make the client double's `registerCallback` return a `Disposable` that records disposal, tear the service down with `unsubscribeAll()`, and observe the callback was never disposed — and that a late engine event still reaches the service.
   
   ### Version/Branch
   
   main
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [ ] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [x] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Reconfiguration service leaks its engine callback past unsubscribeAll [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7822:
URL: https://github.com/apache/texera/issues/7822#issuecomment-5376699866

   <!-- texera:template-compliance -->
   👋 Thanks for opening this issue, @aglinxinyuan!
   
   It looks like the issue description doesn't quite follow our template yet:
   
   - The **What happened?** section is missing; please keep the template's headings.
   
   Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
   
   You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Reconfiguration service leaks its engine callback past unsubscribeAll [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7822:
URL: https://github.com/apache/texera/issues/7822#issuecomment-5376699834

   <!-- texera:template-compliance -->
   👋 Thanks for opening this issue, @aglinxinyuan!
   
   It looks like the issue description doesn't quite follow our template yet:
   
   - The **What happened?** section is missing; please keep the template's headings.
   
   Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
   
   You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Reconfiguration service leaks its engine callback past unsubscribeAll [texera]

Posted by "xuang7 (via GitHub)" <gi...@apache.org>.
xuang7 closed issue #7822: Reconfiguration service leaks its engine callback past unsubscribeAll
URL: https://github.com/apache/texera/issues/7822


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org