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

Update build retry logic #858

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Update build retry logic #858

merged 1 commit into from
Mar 27, 2024

Conversation

llxia
Copy link
Contributor

@llxia llxia commented Mar 27, 2024

When querying a build, TRSS will retry 3 times.
In the case of an error, the build will move back to the queue if the return code from Jenkins API is not 404.
If the return code is 404, x-jenkins header is checked to ensure the error code is from Jenkins (not nginx).
In this case, it means the build has an invalid url or is expired. retry function returns 404 and TRSS will stop processing this build.
Otherwise, the error will be ignored (network issue) and the build will move back to the queue.

  • sleep is removed to increase efficiency and reliability. We will check the header in the response to determine the invalid/expired build case.
  • test API getJenkinsBuildInfo is added
  • fix log issue

related: #852

When querying a build, TRSS will retry 3 times.
In the case of an error, the build will move back to the queue if the return code from Jenkins API is not 404.
If the return code is 404, x-jenkins header is checked to ensure the error code is from Jenkins (not nginx).
In this case, it means the build has an invalid url or is expired. retry function returns 404 and TRSS will stop processing this build.
Otherwise, the error will be ignored (network issue) and the build will move back to the queue.
return code 404 only if the Jenkins server returns 404 for the build (i.e., invalid url, expired build, etc)

- sleep is removed to increase efficiency and reliability. We will check the header in the response to determine the invalid/expired build case.
- test API getJenkinsBuildInfo is added
- fix log issue

related: adoptium#852

Signed-off-by: Lan Xia <[email protected]>
@llxia
Copy link
Contributor Author

llxia commented Mar 27, 2024

This is the server change and it is tested locally.

Copy link

netlify bot commented Mar 27, 2024

Deploy Preview for eclipsefdn-adoptium-trss ready!

Name Link
🔨 Latest commit 255c0ff
🔍 Latest deploy log https://app.netlify.com/sites/eclipsefdn-adoptium-trss/deploys/660465235c7efc000822fc01
😎 Deploy Preview https://deploy-preview-858--eclipsefdn-adoptium-trss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@smlambert smlambert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @llxia !

@smlambert smlambert merged commit a8cd962 into adoptium:master Mar 27, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants