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

How to close connection when listening to BinLog and clear listening thread from mysql process list #35

Open
Woody88 opened this issue Jul 11, 2019 · 1 comment

Comments

@Woody88
Copy link

Woody88 commented Jul 11, 2019

Hi:

How would one go about closing the MySQL connection when listening to binglog events? It seems like the thread hangs when I execute MySQL.close conn. One approach that seems to be partially working is sending an empty packet to the MySQLConn input stream using Streams.unRead. However, when I run Show full processlist in MySQL, I can still see the listening thread in the process list. I have been tackling this for a week now, and I am completely lost.

Thanks in advance.

Woodson D.

@winterland1989
Copy link
Owner

Do you call MySQL.close conn from another Haskell thread? Normally you would use bracket pattern to get a connection, so instead of closing a connection you should simply kill the listening thread and let the listening thread handle the connection closing.

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

No branches or pull requests

2 participants