-
Notifications
You must be signed in to change notification settings - Fork 31
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
Connection Timeout problems after 50 seconds #628
Comments
AnalysisThe observed error does not indicate a TCP timeout situation per se. Instead, it clearly reports a "connection refused" error. See #631 for a more detailed description about it. Using timeout settingsUsing the "timeout" argument is the right choice to explicitly configure the connection timeout setting value in seconds. DBAPIIn DBAPI, you would use it as a function argument 1:1. time python -c 'from crate.client import connect; connect(["192.168.178.100:1234"], timeout=5)' SQLAlchemyIn SQLAlchemy, you would wrap it into the time python -c 'import sqlalchemy as sa; sa.create_engine("crate://192.168.178.101:1234", connect_args={"timeout": 5}).connect()' In both cases, the connection attempt will be terminated within about five seconds.
We confirmed it works on our machine, which is macOS Catalina in this case, connected to a vanilla Fritz!Box WiFi AP. |
Further Analysis and Guessing
I believe what may be happening here is that a CrateDB instance is about to be provisioned on a virtual host machine for integration testing purposes, while the client is already attempting to connect to it. The VM manager / networking subsystem may be capturing the network package(s) until the guest machine is up, and then dispatch them to the machine's IP stack. When this happens, and the guest machine's IP stack comes up, CrateDB has not been started yet, so the host peer will respond with a TCP RST package (WinError 10061), essentially terminating the connection, as outlined at #631. OutlookAfter learning more about the environment where this problem occurs, and whether the scenario matches the hypothesis about the reason for the problem, we can discuss possible solutions. |
Recommendations about building test harnesses for/with CrateDB and PythonHi again,
on behalf of Python programs, we currently recommend to use the Testcontainers for Python implementation for CrateDB, together with pytest. It has not been contributed to the upstream project yet, but it is easy to vendorize. crate/cratedb-examples#72 has corresponding pointers and guidelines, demonstrating its usage on behalf of actual projects. With kind regards, |
Hi again, this report, together with #631, was coming from a scenario where a user is building a test case, which connects to an invalid destination on purpose, in order to validate how the Python driver behaves in this situation. The improvement coming from #571 resolved the problem well:
With kind regards, |
Problem Report
Observations
The database client tries to connect for 50 seconds and then fails with multiple errors.
The text was updated successfully, but these errors were encountered: