-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
packets.go:417: busy buffer, packets.go:436: busy buffer #977
Comments
Please show a reproducible example. It's very likely your application's problem. For example, you may defer rows.Close() but you re-use the trx or conn before the rows.Close() is actually called. But this is not only the case. |
All querys without transactions, Simple Select's.
|
reproducible means I can easily run the example and see the issue. |
Good day, |
I've built a reproducer for our problems. mysql_busy_buffer_reproducer.zip (had to ZIP the file because Github doesn't accept This is the output I'm seeing with
This is the complete output before the example code terminates. While with
I assume this is somewhat related to the re-use of connections, since the problem shows up less if we either decrease the number of concurrent calls to We're using MySQL 10.0.38 and Galera 25.3.25 FWIW. Can I provide anything else to aid in debugging this? |
You must not do it. It execute "USE" statement on only one connection. All other connections runs without on DB. |
Good day, One of us team now try to create reproducible simple code example with this bug. And we not use any "USE ..." query. All query's have database.table
|
The |
I fixed your sample program: And I don't see "busy buffer". |
`I fixed your sample program: And I don't see "busy buffer".` Please provide how you get start example script? with or without race's detector? |
@methane and what exactly you have changed in example? Can't find diff |
That's all. "busy buffer" is not root cause of the problem. Other bugs may cause "busy buffer". |
You wrote
But there are no logs in packets.go:417 or packets.go:436 at master HEAD nor v1.4.1. |
I'm seeing the problem with |
Then you should try v1.4.1 and master HEAD. |
Unless I'm mistaken, 877a977 is the HEAD of
EDIT: |
No, of course not. The error locations in the subject may not be current anymore. As is visible from the output of my test run, the |
|
I've just built a Docker environment to try to make this more reproducible. Curiously enough, the issue doesn't show up when both reproducer and MySQL DB run in Docker containers on my local machine. The DB server we're using is in a DC that's reached through a VPN, with higher latencies. I'll try to get a completely local reproducer working. Thank you for your patience. |
The problem still exist. in most case it can be easy reproduced with some not last mariaDB. Ping method just not work and call panic method |
@oranze Would you provide reproducible example? |
if you try to call Ping() method before call Insert you will get panic. |
It is not a reproducible example. Please add schema, and remove everything relating to HTTP. |
And please paste all panic message. |
It's like it is. one small app to save http incoming data. Sorry but I don't have so many time to create especially predesigned examples. App is short and if http in is a problem you can just cut it and left only one function and move it to main() |
|
What do you mean? If there is a panic, there should be a detailed stacktrace at least. |
I can not confirm this is really an issue of this project. It would be an issue in your application. |
I mean I haven't a free time to cut the code. Panic report I will send today later |
|
There is no useful information that indicates it's a driver's bug, but not your application's bug. |
I hit that issue with the following code:
That causes the I fix that by increase the size of the channel (say I'm not sure if there's any other fix, or if it's a bug or not. |
Hi everyone, I faced with same issue this week
but problem was in memory, my server did not have enough RAM memory, please use Just resize (add more RAM) your server and you will fix it |
In most case, "busy buffer" is just a noise. |
Issue description
Tell us what should happen and what happens instead
in console output:
Scenarion 1:
`[mysql] 2019/07/10 14:54:46 packets.go:417: busy buffer
[mysql] 2019/07/10 14:54:46 packets.go:417: busy buffer
[mysql] 2019/07/10 14:54:47 packets.go:436: busy buffer
[mysql] 2019/07/10 14:54:47 packets.go:417: busy buffer
commands out of sync. You can't run this command now
[mysql] 2019/07/10 14:54:47 packets.go:436: busy buffer
[mysql] 2019/07/10 14:54:47 packets.go:417: busy buffer
commands out of sync. You can't run this command now
[mysql] 2019/07/10 14:54:47 packets.go:436: busy buffer
[mysql] 2019/07/10 14:54:47 packets.go:417: busy buffer
commands out of sync. You can't run this command now
[mysql] 2019/07/10 14:54:47 packets.go:436: busy buffer
[mysql] 2019/07/10 14:54:47 packets.go:417: busy buffer
[mysql] 2019/07/10 14:54:48 packets.go:436: busy buffer
[mysql] 2019/07/10 14:54:48 packets.go:417: busy buffer
sql: expected 4 arguments, got 2
sql: expected 4 arguments, got 2
sql: expected 4 arguments, got 2
**Scenario 2:**
[mysql] 2019/07/10 14:58:53 packets.go:417: busy buffer[mysql] 2019/07/10 14:59:11 packets.go:417: busy buffer
[mysql] 2019/07/10 14:59:43 packets.go:417: busy buffer`
Example code
Scenario 1:
I got a http message to API, create another goroutine (and close a first one to let free http connection) and do something with message, try to get data from MySQL.. all fine if I mak a tests with <100 messages and all bad if I got more then 100 messages per second. Output in the top...
Scenario 2
ok just like a test I create new logic with separate DB connection for each incoming message, works better but expensive by connections resources... and one buffer error. Output in top
Results:
Some part of messages was processed, some (with errors in output, no)... if we get first error in console any other Querys not work, if we try to use ping method before send - hi return nil... All errors handled by mysql golang driver and just printed with log. but not returned to upper level (????!!!)
So like a result impossible to detect error and establish new connection.
And yes all fine if you have <100 requests and <100 DB querys.
P.S.
I have found issue (dated by 2015) about same problems in multi routines mode, but this absolutely not explained why we cant handle error on app level and why we still get :417 error in each 1 goroutine=1 DB connector mode. Any Ideas how to solve this?
Error log
Configuration
Driver version (or git SHA):
last
Go version: run
go version
in your console1.12.6
Server version: E.g. MySQL 5.6, MariaDB 10.0.20
Server OS: E.g. Debian 8.1 (Jessie), Windows 10
Windows 10
The text was updated successfully, but these errors were encountered: