codeant-ai-for-open-source[bot] commented on PR #38576:
URL: https://github.com/apache/superset/pull/38576#issuecomment-4037281974

   ## **Sequence Diagram**
   
   This PR changes how dashboard thumbnail requests and Celery tasks interact 
with the cache to prevent concurrent Selenium sessions for the same dashboard 
by marking work as computing before enqueue and having tasks skip when a 
non-stale computation is already in progress.
   
   ```mermaid
   sequenceDiagram
       participant User
       participant DashboardAPI
       participant Cache
       participant ThumbnailTask
   
       User->>DashboardAPI: Request dashboard thumbnail
       DashboardAPI->>Cache: Read thumbnail cache state
   
       alt No active computation and trigger allowed
           DashboardAPI->>Cache: Set status to COMPUTING
           DashboardAPI->>ThumbnailTask: Enqueue thumbnail task
           DashboardAPI-->>User: Respond with pending thumbnail
       else Already computing or should not trigger
           DashboardAPI-->>User: Respond using existing cache state
       end
   
       ThumbnailTask->>Cache: Check thumbnail cache state
   
       alt Status is COMPUTING and not stale
           ThumbnailTask-->>ThumbnailTask: Skip thumbnail generation
       else Not computing or computing is stale
           ThumbnailTask-->>ThumbnailTask: Generate thumbnail and update cache
           ThumbnailTask->>Cache: Store thumbnail and final status
       end
   ```
   
   ---
   *Generated by [CodeAnt AI](https://codeant.ai)*
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to