Databricks: Invalid token, server shutdown and bad http path are not handled
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with pyhive/hive.py and thrift.transport.TTransport.TTransportBase.readAll, then inspect the TBinaryProtocol transport response fields described in the issue. Reproduce an invalid token, bad HTTP path, or shutting-down cluster case; done means the server's response information is surfaced instead of only EOFError.
Written by the indexing model from the issue text.
Description
In case when the token is invalid, just EOFError is raised, without any explanation. Though the response from a server contains a meaningful message.
TBinaryProtocol.trans contain code=403, message='forbidden' and headers. But never checked.
File "pyhive/hive.py", line 104, in connect
return Connection(*args, **kwargs)
File "pyhive/hive.py", line 249, in __init__
response = self._client.OpenSession(open_session_req)
File "TCLIService/TCLIService.py", line 187, in OpenSession
return self.recv_OpenSession()
File "TCLIService/TCLIService.py", line 199, in recv_OpenSession
(fname, mtype, rseqid) = iprot.readMessageBegin()
File "thrift/protocol/TBinaryProtocol.py", line 148, in readMessageBegin
name = self.trans.readAll(sz)
File "thrift/transport/TTransport.py", line 68, in readAll
raise EOFError()
EOFError
Same for bad HTTP path
put just 's' to HTTP path and other and keep other values from working connection settings
TBinaryProtocol.trans contain code=303, message='See other'
Same stack trace.
Also, EOFError raised when token invalidated after connection and when databricks cluster shutting down
The reason is thrift.transport.TTransport.TTransportBase.readAll just raises EOFError on the empty body regardless of response headers.
That may be the issue with thrift code.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 545
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dropbox/PyHive
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100