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

fix: connection leak when concurrent updates #669

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

jjeffcaii
Copy link
Contributor

What this PR does:

Which issue(s) this PR fixes:

Fixes #639

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@codecov-commenter
Copy link

Codecov Report

Patch coverage: 15.38% and project coverage change: +0.01 🎉

Comparison is base (08d66c8) 36.79% compared to head (3e13930) 36.81%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #669      +/-   ##
==========================================
+ Coverage   36.79%   36.81%   +0.01%     
==========================================
  Files         204      204              
  Lines       22428    22724     +296     
==========================================
+ Hits         8253     8366     +113     
- Misses      13258    13427     +169     
- Partials      917      931      +14     
Impacted Files Coverage Δ
pkg/mysql/client.go 32.78% <0.00%> (+2.05%) ⬆️
pkg/mysql/execute_handle.go 0.00% <0.00%> (ø)
pkg/mysql/server.go 0.00% <0.00%> (ø)
pkg/runtime/runtime.go 4.21% <ø> (+0.89%) ⬆️
pkg/mysql/conn.go 40.03% <22.22%> (+4.04%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jjeffcaii
Copy link
Contributor Author

In short words, we close the request-response lifecycle too soon when executing EXEC operations, see the picture below:

image

@@ -772,7 +774,7 @@ func (c *Conn) writeErrorPacket(errorCode uint16, sqlState string, format string
sqlState = mysql.SSUnknownSQLState
}
if len(sqlState) != 5 {
panic("sqlState has to be 5 characters long")
panic(fmt.Sprintf("sqlState has to be 5 characters long, actual is %d!", len(sqlState)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能返回 error 吗?panic 不能轻易启用。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回string吧,感觉更常见些。

@dongzl dongzl added this to the 0.2.0 milestone Apr 6, 2023
@dongzl dongzl added the bug Something isn't working label Apr 6, 2023
Copy link
Contributor

@maronghe maronghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dongzl dongzl merged commit 6729dfe into arana-db:master Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sysbench] when use sysbench for arana test, not success
7 participants