-
Notifications
You must be signed in to change notification settings - Fork 103
Provide actionable feedback when internal operations are failing rather than silently retrying for over 10mins #346
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
Comments
To all intents and purposes the library has hung - there is no feedback that the operation is failing and being retried multiple times or any indication of why it is failing. Maybe this issue is more of a request for better feedback in the case of failing HTTP operations. |
The 403 is pretty fishy. Debugging a bit further I can see the token being passed in the headers: >>> headers
{'Content-Type': 'application/x-thrift',
'Content-Length': '167',
'User-Agent': 'PyDatabricksSqlConnector/3.0.1 (sqlalchemy + )',
'Authorization': 'Bearer <snip>d6b6'} The token being passed is the same as my default environment variable: ❯ echo $env:DATABRICKS_TOKEN
<snip>d6b6 BUT in my calling script I explicitly set the correct token to use: os.environ['DATABRICKS_TOKEN'] = '<snip>60cd' ...so it seems the token is somehow not being picked up? |
Do you know what kind of Thrift request is being sent that results in this 403 failing with the 403? Is it an
Is this true even when you have your log level set at Adding this to your script will help with the repro: import logging
logging.getLogger("databricks.sql").setLevel(logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.DEBUG)
Yeah, generally a 403 should halt everything since authentication errors are by-nature not recoverable. The DBX team should investigate. Likely the fix will be an additional conditional check added to the |
Circling back since I just hit this again. If I configure logging like: import logging
logging.basicConfig(level='DEBUG')
logging.getLogger("databricks.sql").setLevel(logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.DEBUG) I do get some feedback! 🎉
|
however, I don't think users should have to (know how to) configure logging to get critical usage information from the library. The library should not appear to hang indefinitely without providing any feedback/information to the user. In this particular case, I don't think the library should be responsible for retries at all - just raise an exception and let the user decide how best to handle the error. Certainly, indefinitely retrying a 403 isn't going to lead to success. |
FWIW, chiming it to say that I hit the same issue (invalid token), can see exactly the same output from urllib3 (after setting the log level appropriatley) and was similarly stymied for an hour by the apparently-hung process. Failing loudly on 403 seems like the right solution here. |
I'm trying to debug a problem where my request appears to hang indefinitely.
If I pause the program in the debugger it's deep in a retry loop in
urllib
...and it seems the default timeout for requests is 15mins
The text was updated successfully, but these errors were encountered: