Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#2656: [SonataFlow] Jobs List Status Continues to Report "Expires in NN Minutes" After Job Expiration #2727

Conversation

fantonangeli
Copy link
Contributor

@fantonangeli fantonangeli commented Nov 6, 2024

Closes #2656

Description:

The jobs list status continues to display expires in NN minutes even after a job has expired.

Steps to Reproduce

  1. Go to: https://start.kubesmarts.org/dev
  2. Setup an OpenShift connection with DevMode
  3. Create a workflow using https://github.com/dmarrazzo/swf-simple-order/blob/main/src/main/resources/timeout.sw.yaml
  4. Upload the workflow to OpenShift in DevMode
  5. Start the workflow and quickly move to the next step
  6. Open the workflow details and view the Jobs list
  7. Observe that the job shows "expires in a few seconds" (see screenshot 1)
  8. Wait a few minutes after the expiration time
  9. Observe that the job expiration changes to "expires in NN minutes" and the status remains as "scheduled" (see screenshot 2)

Expected Result

The jobs list should refresh after the job expiration.

Actual Result

After expiration, the jobs list shows "expires in NN minutes" and the status remains "scheduled" even after expiration.

image
image

Solution:

  • Check every 5 seconds if there is a SCHEDULED job.
  • If the job is not expired check again after 5 seconds
  • If the job is expired refresh the jobs data from the data-index

How to test locally:

curl -X POST http://localhost:4000/graphql \
     -H "Content-Type: application/json" \
     -d '{
           "query": "mutation JobExecute($id: String!) { JobExecute(id: $id) }",
           "variables": {
             "id": "a62d9d0a-87ea-4c13-87fb-67965d133020"
           }
         }'
  • wait 5 seconds
  • the status of the job "a62d9d0" is "Executed"

Preview:

kie-tools-issues.2656.webm

Notes:

  • I refactored some code to align more the WorkflowDetaills component to ProcessDetails and use the useCallback like in React best practices and fix lint warnings
  • @tiagobento Maybe you are interested to replicate this functionality to packages/runtime-tools-process-enveloped-components/src/processDetails/envelope/components/ProcessDetails/ProcessDetails.tsx ?
  • thanks @dmarrazzo for the repository with test Workflows

@fantonangeli fantonangeli merged commit e607b8a into apache:main Nov 12, 2024
14 checks passed
@fantonangeli fantonangeli deleted the kie-tools-issues#2656-SonataFlow-Jobs-List-Status-Continues-to-Report-Expires-in-NN-Minutes-After-Job-Expiration branch November 12, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SonataFlow] Jobs List Status Continues to Report "Expires in NN Minutes" After Job Expiration
4 participants