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

Return proper REST API view status codes for project lock exceptions #1847

Closed
mikkonie opened this issue Dec 4, 2023 · 1 comment
Closed
Assignees
Labels
app: landingzones Issue in the landingzones app app: taskflowbackend Issue in the taskflowbackend app breaking Breaking change, to be implemented and documented with care feature Requested feature or enhancement
Milestone

Comments

@mikkonie
Copy link
Contributor

mikkonie commented Dec 4, 2023

It seems we raise the same locking exception in TaskflowAPI.run_flow() regardless whether the lock is active or if there's an unexpected problem, such as the Redis server being misconfigured or unavailable.

This is a problem because in e.g. ZoneSubmitMoveAPIView, we should return a different status based on what type of locking exception was encountered. The response should be 503 if the project is simply locked, or 500 if e.g. a Redis error occurs. Right now, we return APIException with the status of 500 in any case.

As this is a slightly breaking change for the REST API, I'm tentatively setting this for the v1.0 milestone.

This is related to #1842 and #1844.

@mikkonie mikkonie added breaking Breaking change, to be implemented and documented with care feature Requested feature or enhancement app: landingzones Issue in the landingzones app app: taskflowbackend Issue in the taskflowbackend app labels Dec 4, 2023
@mikkonie mikkonie added this to the v1.0.0 milestone Dec 4, 2023
@mikkonie mikkonie self-assigned this Dec 4, 2023
@mikkonie
Copy link
Contributor Author

Done, albeit with a somewhat ugly hack. Exception handling in taskflow should be improved in the future, see #1505.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: landingzones Issue in the landingzones app app: taskflowbackend Issue in the taskflowbackend app breaking Breaking change, to be implemented and documented with care feature Requested feature or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant