crate / crate-python

Python DB API client library for CrateDB, using HTTP.
https://cratedb.com/docs/python/
Apache License 2.0
79 stars 30 forks source link

Connection initializing while db is starting up #415

Closed teodorpatras closed 3 years ago

teodorpatras commented 3 years ago

Hi everyone,

we have noticed that if we initiate a connection via client.connect(address) while the db is starting up, the db server returns 400 Bad Request to client.server_infos which in turn leads to a ProgrammingError being raised from client._raise_for_status.

I was wondering if the ProgrammingError has been left out of this except clause on purpose:

https://github.com/crate/crate-python/blob/99daef4c39d89ac41c02533e8c6becd67f5c76b5/src/crate/client/connection.py#L160-L164

CrateDB 4.6.x crate 0.26.0

L.E: This issue started to happen after we upgraded CrateDB from 4.5.x to 4.6.x.

Looking forward to your reply, Teo

amotl commented 3 years ago

Hi Teo,

thank you for your report. I just took a quick look at the code without going into the details yet.

It looks like this code [1] was written seven years ago and has not been modified since then. [2] shows that the requirement to urllib3>=1.9 is also from 2014 already, so there might be a good chance that things have been moved under the hood.

With kind regards, Andreas.

[1] https://github.com/crate/crate-python/blame/0.26.0/src/crate/client/connection.py#L160-L164 [2] https://github.com/crate/crate-python/blob/0.26.0/setup.py#L27-L29

amotl commented 3 years ago

Hi again,

as @seut suggested, this is probably a regression with CrateDB 4.6. So, thanks already for creating https://github.com/crate/crate/issues/11699 in order to investigate this further on this end.

Closing this.

With kind regards, Andreas.