On Monday, December 30, 2019 at 9:07:45 AM UTC-6, Mike Bayer wrote:
>
>
> On Sun, Dec 29, 2019, at 11:54 PM, Brian Paterni wrote:
>
> On Sunday, December 29, 2019 at 1:17:24 AM UTC-6, Mike Bayer wrote:
>
>
> I can't run the test app however 15 seems like your connection pool is set 
> up at its default size of 5 connections + 10 overflow, all connections are 
> being checked out, and none are being returned.
>
>
> Hm, is the issue with running the app possibly something I could help with?
>
>
> sure, if you can turn it into a single file, runnable MCVE with zero 
> depedendencies other than SQLAlchemy, a single MSSQL Python driver (please 
> note that MS's ODBC driver, while necessary, is not a Python driver by 
> itself), and in this case eventlet, I can run that.      However I think 
> you likely should be able to reproduce your issue not using SQLAlchemy at 
> all and simply using pyodbc directly assuming that's the driver you are 
> using.
>
>
> http://stackoverflow.com/help/mcve
>
>
I've created: https://github.com/bpaterni/simple-blocking-eventlet

Which should be a stripped down version of the flask-app I'd posted before.

You are correct in that the problem persists when using only pyodbc, and as 
a result I've gone ahead and created an issue with that project in order to 
try and get at the source of this problem: 
https://github.com/mkleehammer/pyodbc/issues/694
 

>
> Apparently it *does* (or should) support async, as it is mentioned several 
> times in the RELEASE_NOTES shipped with the driver. I'm not sure if it's 
> does so implicitly or explicitly though.
>
>
> unfortunately things are not that simple.   PostgreSQL for example 
> supports a non-blocking API.  However, you can't just use psycopg2 out of 
> the box and expect it to work, psycopg2 offers an explicit API for this 
> that has to be adapted, which you can see here: 
> http://initd.org/psycopg/docs/advanced.html#green-support   in order for 
> that API to work with eventlet, you need to use a special eventlet 
> adaptation form here:  https://pypi.org/project/psycogreen/
>
>
I believe psycogreen (or it's intended behavior) has already been 
integrated into eventlet: 
https://github.com/eventlet/eventlet/blob/master/eventlet/support/psycopg2_patcher.py

which is probably the reason postgresql has been implicitly working as 
expected this whole time.

I agree that some additional hoops may need to be jumped in order for MSSQL 
to work as expected, but this hang on >= 15 busy connections is strange. 
Hopefully it is something that can be bandaid'ed in pyodbc until some kind 
of genuine async interface can be added to the project...

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/e5d47afa-dbfa-4d99-b5e9-47fe6ab0690f%40googlegroups.com.

Reply via email to