Skip to content
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

Deprecate waiter #285

Merged
merged 1 commit into from Nov 5, 2018
Merged

Deprecate waiter #285

merged 1 commit into from Nov 5, 2018

Conversation

methane
Copy link
Member

@methane methane commented Nov 5, 2018

No description provided.

@methane methane merged commit 21170a7 into PyMySQL:master Nov 5, 2018
@methane methane deleted the deprecate-waiter branch November 5, 2018 12:28
@baodongli
Copy link

I was trying to find out why the waiter option gets removed. Can you comment on that?
With it removed, is mysqlclient gevent friendly?
thanks

@methane
Copy link
Member Author

methane commented Mar 3, 2019

  • There are too small users. I want to reduce code I must maintain.
  • Even with waiter, mysqlclient will block gevent. Threadpool is better way to use MySQL from async framework.
  • PyMySQL is better than mysqlclient for gevent.

@baodongli
Copy link

Thanks for your response. We're currently using flask + SQLAlchemy extension + mysqlclient. In the following scenario, we found that the entire application gets blocked for 50s (the amount of time for a SQL transaction to time out).
- An API request will cause a "select for update" query to be issued and a row will be locked. Subsequently the processing green thread issues another request and yields
- Another API request comes in and gets handled with another green thread (call it thread 2) and issues a query that results in the same row as in the previous request. Since the row has been locked and thread 2 doesn't yield as a result of issuing the DB query, the entire application gets blocked.

We are looking for solutions to the above problem, and found the waiter option, only to find that it's removed from the latest release. So I went back to an earlier release, and found that the application were no longer blocked.

Can you elaborate on your second comment? Does the concurrency depend on the number of connections available in the SQLAlchemy engine? How is the Threadpool integrated with flask, SQLAlchemy?

We'll try PyMySQL. But in the same time, I'd like to understand the underlying mechanism between the waiter option and PyMySQL. Any pointer is appreciated.

Thanks.

@methane
Copy link
Member Author

methane commented Mar 3, 2019

Can you elaborate on your second comment? Does the concurrency depend on the number of connections available in the SQLAlchemy engine? How is the Threadpool integrated with flask, SQLAlchemy?

You should use thread or process. uWSGI provides both options.

We'll try PyMySQL. But in the same time, I'd like to understand the underlying mechanism between the waiter option and PyMySQL. Any pointer is appreciated.

No. It's expert only option. Only who can understand everything by reading source could use it.
People asking question on issue tracker must not use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants