-
Notifications
You must be signed in to change notification settings - Fork 26
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
Make readiness timeout configurable #13
Comments
This idea probably makes sense, and I would like to add it as an option at some point. However, it may be more efficient for you to use the Please let me know if that helps. |
I'll try to set |
Unfortunately, I couldn't reproduce the bug again, even though I'll get back whenever the bug is reproduced. |
Thanks for the update, but just to clarify do you mean: Adding --ready-check-path=/healthz seems to work well for your dashboard starting OK. But that you no longer have the problem anyway, even if you drop --ready-check-path again. ? |
Yes, that's it. |
The bug is still happening even with |
I reproduced the bug with the following flask app: from flask import Flask
from time import sleep
app = Flask(__name__)
@app.route('/')
def hello_world():
sleep(30)
return 'Hello, World!' and theses configurations: c.CDSDashboardsConfig.presentation_types = ['flask']
c.VariableMixin.extra_presentation_launchers = {
'flask': {
'args': [
'flask', 'run', '{--}port={port}'
],
'env': {'FLASK_APP': 'app.py'},
}
} |
A better reproduction app: from flask import Flask
from time import sleep, time
app = Flask(__name__)
started_at = time()
ready_after = 30
@app.route('/')
def hello_world():
now = time()
if now - started_at > ready_after:
return 'Appliation ready!'
else:
# sleep for more that 1 seconds to make the _ready_check call fail:
# https://github.com/yuvipanda/simpervisor/blob/master/simpervisor/process.py#L196
# Even status code 400 is considered as ready as per https://github.com/ideonate/jhsingle-native-proxy/blob/master/jhsingle_native_proxy/proxyhandlers.py#L707
# return 'Application not yet ready! Please try later', 400
sleep(5) Why better?The first app will always fail to start even if we increase the |
By the way, it would be great if you'd like to take a look at the experimental Flask framework: https://cdsdashboards.readthedocs.io/en/stable/chapters/userguide/frameworks/flask.html That should be more flexible for being able to specify a flask script to run, and it does it through gunicorn instead of the dev server. There may be some tweaks needed... |
I'm having an issue integrating cdsdashboards to our ML platform http://iko.ai, my dashboard server is timing out during readiness and there is no way to configure the time out value because it's hardcoded here: https://github.com/ideonate/jhsingle-native-proxy/blob/master/jhsingle_native_proxy/proxyhandlers.py#L700
I'd like to be able to configure the readiness timeout value through command-line argument and/or environment variables?
Debug logs:
The text was updated successfully, but these errors were encountered: