questdb / py-questdb-client

Python client for QuestDB InfluxDB Line Protocol
https://py-questdb-client.readthedocs.io
Apache License 2.0
50 stars 7 forks source link

Sender does not throw an exception when connected to a non-ILP socket #20

Closed M0dEx closed 1 year ago

M0dEx commented 1 year ago

We have come across an issue where the Sender does not throw an exception when connected to an open non-ILP TCP socket. (eg. connecting to the port 8812 meant for SQL connections).

This results in the Sender "writing" to the database seemingly without a problem, when in reality nothing is being written to the database. No exception, no hint something may be incorrectly configured.

Steps to reproduce:

import time
from questdb.ingress import Sender

with Sender("valid_host", 8812, auto_flush=True) as sender: # Or any other open TCP socket
    while True:
        sender.row("exampleTable", symbols={"symbol": "test"}, columns={"column": "test"})
        time.sleep(1)

Additional Information:

OS: MacOS 12.6 and Windows 11 21H2

amunra commented 1 year ago

This is really a QuestDB issue: The server should close the socket if receiving ILP over the PG wire protocol. This would cause the Python Sender to disconnect and raise an error. I'll close this ticket and raise a new one.