influxdb-client-python
influxdb-client-python copied to clipboard
atexit doesn’t work properly in batch mode: "cannot schedule new futures after interpreter shutdown"
Hello,
Specifications
- Client Version: 1.41.0
- InfluxDB Version: 2.7.5
- Platform: Ubuntu 23.10
Code sample to reproduce problem
import atexit
from influxdb_client import InfluxDBClient, Point
influxdb = InfluxDBClient(url="...", token="...", org="...")
write_api = influxdb.write_api()
@atexit.register
def close():
print("closing")
write_api.close()
influxdb.close()
write_api.write("<bucket>", record=Point("test_bf").field("test", 1))
Expected behavior
Expected output:
closing
Actual behavior
Actual output:
The batch item wasn't processed successfully because: cannot schedule new futures after interpreter shutdown
closing
As you can see the atexit
handler is executed, but the error happens before.
Additional info
No response
looks like issues aren't addressed :(
Hi @rwader-swi,
Thanks for bringing this to our attention. I appreciate you sharing your concerns with us. I have added this issue to our backlog, and we aim to address it in our next maintenance release.
We value your input as it helps us improve and ensure our software meets user needs. I'll keep you updated on our progress regarding this issue.
Best regards
FYI I can still reproduce this issue with the latest version of the client.
Client Version: 1.46.0 Python Version: 3.11.10 InfluxDB Version: 2.7.5 Platform: Ubuntu 24.04.1 LTS