exasol / pyexasol

Exasol Python driver with low overhead, fast HTTP transport and compression
MIT License
72 stars 39 forks source link

Document that Connection sharing with multiprocessing doesn't work with TLS Encryption #89

Closed tkilias closed 2 years ago

tkilias commented 2 years ago
littleK0i commented 2 years ago

Honestly, I do not understand why people keep trying this when clear instructions for parallelism are provided: https://github.com/exasol/pyexasol/blob/master/docs/HTTP_TRANSPORT_PARALLEL.md

threadsafety level is 1: https://github.com/exasol/pyexasol/blob/master/pyexasol/connection.py#L37-L45

Also, there is an exception for attempt to run second request from another thread: https://github.com/exasol/pyexasol/blob/master/pyexasol/connection.py#L514-L518

Connections should not be shared across multiple processes. Connections can be shared across multiple threads, but only thread can run requests in parallel.

If customer wants to run multiple queries in parallel, one connection per query is required.

If customer wants to read large data set in parallel, HTTP transport is the best bet. It requires 1 process for connection and management and any number of worker processes.

tkilias commented 2 years ago

Yes, agree, but it happens again and again. That's why I thought, to state it clearly and providing guidance might help.

littleK0i commented 2 years ago

I'll add a page tomorrow, it's ok.

tkilias commented 2 years ago

thx

littleK0i commented 2 years ago

@tkilias , please take a look: https://github.com/exasol/pyexasol/blob/master/docs/PARALLELISM.md

tkilias commented 2 years ago

thx, looks good.