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

   ### What happened?
   
   The frontend learns that a run has ended only from the engine, over the 
selected unit's websocket. When the selected unit is terminated from the unit 
dropdown, or drops out of the unit list, while a run is in flight, that message 
never arrives and nothing resets the execution state. The run keeps being 
reported as running:
   
   - The canvas Kill button stays enabled, but clicking it does nothing.
   - The run clock keeps counting.
   - Form View keeps saying "Running -- this keeps going if you look away." 
(`workflow-form.component.html:399`).
   - The execution state stays Running, which keeps the canvas locked.
   
   Nothing resets the execution when the selection is cleared. 
`ComputingUnitStatusService.setComputingUnitsState` sets the selection to 
`null` when the unit leaves the list 
(`computing-unit-status.service.ts:111-125`), and `terminateComputingUnit` 
closes the websocket itself (`:293-299`), but neither emits anything 
`ExecuteWorkflowService` listens to.
   
   The Kill button stays enabled because its gate exempts `NoComputingUnit` 
from the socket check:
   
   ```html
   <!-- frontend/src/app/workspace/component/menu/menu.component.html:430-439 
-->
           <button
             (click)="handleKill()"
             [disabled]="
           executionState === ExecutionState.Uninitialized ||
           executionState === ExecutionState.Completed ||
           executionState === ExecutionState.Killed ||
           executionState === ExecutionState.Failed ||
           (!workflowWebsocketService.isConnected &&
          computingUnitStatus !== ComputingUnitState.NoComputingUnit)
         "
   ```
   
   #3400 (a910bcfd5) added the socket check to Kill together with this 
exemption, copying the Run button's translation of the old single-mode flag 
`!environment.computingUnitManagerEnabled`; that mode no longer exists. After a 
dropdown terminate the websocket subject is already completed, so the kill 
request is simply dropped.
   
   Reproduced in Chrome with a local unit. Running, before the terminate:
   
   <img width="1512" height="805" alt="Image" 
src="https://github.com/user-attachments/assets/58cddf36-cd76-482a-b948-e07c5c64552f";
 />
   
   After terminating the selected unit from the dropdown and clicking Kill:
   
   <img width="1512" height="805" alt="Image" 
src="https://github.com/user-attachments/assets/e0919b87-0c2b-4138-a30b-12295b749175";
 />
   
   ### How to reproduce?
   
   1. Workflow: Text Input -> Python UDF whose `process_tuple` does 
`time.sleep(900)`.
   2. Select a unit, click Run, and wait until the UDF operator is running.
   3. Open the unit dropdown, click the trash icon of the selected unit, and 
confirm.
   4. Kill stays enabled and clicking it does nothing; the clock keeps 
counting; Form View keeps saying "Running".
   
   ### Version/Branch
   
   1.4.0-incubating-SNAPSHOT (main)
   
   ### Commit Hash (Optional)
   
   _No response_
   
   ### What browsers are you seeing the problem on?
   
   _No response_
   
   ### Relevant log output
   
   ```shell
   
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to