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

   ### What happened?
   
   When a workflow opens, `ComputingUnitSelectionComponent.selectInitialUnit` 
restores a unit in this order: the unit remembered for the workflow if it is 
still listed, else the unit of the workflow's last execution, else the first 
Running unit when the workflow has never run. The remembered-unit step checks 
the unit list first (`computing-unit-selection.component.ts:368-397`). The 
last-execution step does not:
   
   ```ts
   // 
frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts:412-425
           next: (latestWorkflowExecution: WorkflowExecutionsEntry) => {
             if (stillShown()) {
               if (selectUnit) {
                 this.selectComputingUnit(wid, latestWorkflowExecution.cuId);
               }
               this.lastExecutionWhid = latestWorkflowExecution.whId ?? 
undefined;
               this.applyWarehousePreselect();
             }
           },
           error: () => {
             const runningUnit = this.allComputingUnits.find(unit => 
unit.status === "Running");
             if (selectUnit && stillShown() && runningUnit) {
               this.selectComputingUnit(wid, runningUnit.computingUnit.cuid);
             }
   ```
   
   Two defects follow:
   
   - `/api/executions/{wid}/latest` also returns terminated units. For such a 
unit, `ComputingUnitStatusService.selectComputingUnit` misses its cache, 
refreshes the list and waits for that `cuid` to appear 
(`computing-unit-status.service.ts:193-205`), which never happens. The workflow 
opens with no unit selected and the run button reads "Computing Unit", even 
while another unit is Running. The fallback to a Running unit runs only when 
the lookup fails, so it never helps here.
   - That fallback reads `allComputingUnits` synchronously, so for a workflow 
that has never run it also selects nothing when the unit list has not loaded 
yet.
   
   Reproduced in Chrome with local units. The workflow last ran on "Analytics 
Unit":
   
   <img width="1512" height="805" alt="Image" 
src="https://github.com/user-attachments/assets/e2d57c75-0393-4798-8156-4d301004c34d";
 />
   
   After terminating "Analytics Unit" and reloading, "My Computing Unit" is 
Running but nothing is selected:
   
   <img width="1512" height="805" alt="Image" 
src="https://github.com/user-attachments/assets/c4e8d9db-936b-44bd-8d70-4ccb70b86b50";
 />
   
   ### How to reproduce?
   
   1. Create two local computing units; both are Running.
   2. Open a workflow, select unit A, run it, and wait for it to complete.
   3. Terminate unit A from the unit dropdown.
   4. Reload the workflow. No unit is selected, although unit B is 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