scylladb / scylla-machine-image

Apache License 2.0
18 stars 25 forks source link

scylla_post_start.py and scylla_configure.py should not exit with 0 when HTTP Error occurs #505

Closed syuu1228 closed 1 month ago

syuu1228 commented 4 months ago

Related with #498

On current curl() implementation, all exceptions are catched to retrying access and never re-raised. Because of this, we currently not able to get any HTTP Error related exception. We should re-raise the exception after all retries are failed.

Or, maybe we don't need to retry for all HTTP Error, since the metadata server may returns specific error code when it's not available.

syuu1228 commented 3 months ago

I was wrong, curl() is actually re-raise exception when HTTP Error received. However, scylla_post_start.py and scylla_configure.py are catching exceptions and log it as ERROR but it will continue program and always exit with 0. I think it should at least exit with 1 if Exception catched, or even stop catching Exception and cause Traceback.

syuu1228 commented 3 months ago

BTW, curl() also has problem. It unconditionally retries HTTP request when error occurs, even HTTP error was 404 Not Found - it unlikely fix by retrying. I think we should stop retrying when HTTP Error was 400-499 (Client error responses, like 404 Not found or 403 Forbidden).