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

Build marked as "Failed" when "exit 183" ("skip the build") is used #10567

Closed
vstinner opened this issue Jul 25, 2023 · 5 comments · Fixed by #10573
Closed

Build marked as "Failed" when "exit 183" ("skip the build") is used #10567

vstinner opened this issue Jul 25, 2023 · 5 comments · Fixed by #10573

Comments

@vstinner
Copy link

Details

Expected Result

ReadTheDocs documentation says that exit 183 can be used to skip a build: I expect the build to be reported to GitHub as a "success".

Actual Result

The build was reported to GitHub as a failure:

docs/readthedocs.org:cpython-previews — Read the Docs build failed!

My related PR which triggered the doc build: python/cpython#107235

@vstinner
Copy link
Author

Build URL (if applicable): https://readthedocs.org/projects/cpython-previews/builds/21404205/

This URL seems to say that the build is still running, wheareas it was already reported as a failure to GitHub.

Building ...

@vstinner
Copy link
Author

I triggered a new doc build job: https://readthedocs.org/projects/cpython-previews/builds/21404472/

It completed as expected as "Build cancelled", and was reported as expected as a success to GitHub PR: good!

The strange thing is that the first job https://readthedocs.org/projects/cpython-previews/builds/21404205/ executed cat .readthedocs.yml and asdf global python 3.11.4 commands 3 times in a row! Moreover, right now, it still says "Building ...", as if it didn't complete.

@hugovk
Copy link
Contributor

hugovk commented Jul 25, 2023

Looking at timestamps in the logs:

https://beta.readthedocs.org/api/v2/build/21404205.txt

Seems it logged each command three times, rather than running three times. The timestamps for each repeated command is identical.

@stsewd
Copy link
Member

stsewd commented Jul 25, 2023

Hi, we were doing a deploy during that time, so that's probably the cause of the duplicate commands (to save the commands we hit an API, if this is retried, it will duplicate the commands).

@vstinner
Copy link
Author

Hi, we were doing a deploy during that time

Since the following job was fine, feel free to close the issue if you consider it to be fixed.

humitos added a commit that referenced this issue Jul 26, 2023
Sometimes it happens the web servers are congested and the builder retries the
API call to save the command in the database. However, one of the first attempts
finally ended up working resulting in the command being saved twice.

This small chunk of code checks for the existence of the command before saving
it into the database and logs a warning and return 204 if it already exists,
instead of re-saving it again.

It's not a perfect solution, but it could help under similar circumstances.

Related #10567
humitos added a commit that referenced this issue Aug 1, 2023
* Build: skip duplicated commands

Sometimes it happens the web servers are congested and the builder retries the
API call to save the command in the database. However, one of the first attempts
finally ended up working resulting in the command being saved twice.

This small chunk of code checks for the existence of the command before saving
it into the database and logs a warning and return 204 if it already exists,
instead of re-saving it again.

It's not a perfect solution, but it could help under similar circumstances.

Related #10567

* Test case for duplicated BuildCommandResult

* Add `start_date` to the filter

* Typo

* Update readthedocs/api/v2/views/model_views.py

Co-authored-by: Santos Gallegos <stsewd@proton.me>

---------

Co-authored-by: Santos Gallegos <stsewd@proton.me>
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 a pull request may close this issue.

3 participants