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 bug 1580227 (Killed connection threads might get their sockets cl… #500

Merged
merged 1 commit into from
May 12, 2016

Conversation

laurynas-biveinis
Copy link
Contributor

…osed twice on shutdown)

In some scenarios, THD::disconnect might get called twice for a single
connection, e.g. the first time by kill_server_threads -> kill_server
-> close_connections -> close_connection, and the second time by
handle_one_connection -> do_handle_one_connection ->
close_connection. This will result in the 1st call closing the network
socket and setting it to -1 and the 2nd call calling close on -1.

Fix by checking VIO state before calling close on the socket.

http://jenkins.percona.com/job/percona-server-5.6-param/1129

…osed twice on shutdown)

In some scenarios, THD::disconnect might get called twice for a single
connection, e.g. the first time by kill_server_threads -> kill_server
-> close_connections -> close_connection, and the second time by
handle_one_connection -> do_handle_one_connection ->
close_connection. This will result in the 1st call closing the network
socket and setting it to -1 and the 2nd call calling close on -1.

Fix by checking VIO state before calling close on the socket.
@percona-ysorokin
Copy link
Collaborator

LGTM

@laurynas-biveinis laurynas-biveinis merged commit 56e12c4 into percona:5.6 May 12, 2016
@laurynas-biveinis laurynas-biveinis deleted the bug1580227-5.6 branch May 12, 2016 12:58
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 23, 2020
Summary:
Interface MySQL provides for implementing custom storage engines is
quite cumbersome. For the purposes of the debugging and understanding
the flow of execution we need to be able to clearly observe and trace
how MyRocks code is being called. Interface itself is described in
`sql\handler.h`.

As a standard solution, MySQL exposes DBUG package and various macros
associated with it.

This set of changes makes sure that every call to any of the functions
MyRocks implements will be tracked with a pair of `DBUG_FUNC_CALL` and
`DBUG_RETURN*` macros. We can now change DBUG settings during runtime
(`SET GLOBAL debug = '+d,enter,exit:L';` or something similar) and
observe the execution flow.

`DBUG_FUNC_CALL` is a simple customization based on `DBUG_ENTER` and it
uses `__PRETTY_FUNCTION__` to delegate the work of composing correct
function names to a compiler. Yes, this functionality is specific to
`Clang` or `GCC` and these are the only toolsets we care about now.

For future references: please use
Closes facebook/mysql-5.6#500

Reviewed By: lth

Differential Revision: D4391700

Pulled By: gunnarku

fbshipit-source-id: 56f2c001f56
inikep pushed a commit to inikep/percona-server that referenced this pull request Feb 24, 2021
Summary:
Interface MySQL provides for implementing custom storage engines is
quite cumbersome. For the purposes of the debugging and understanding
the flow of execution we need to be able to clearly observe and trace
how MyRocks code is being called. Interface itself is described in
`sql\handler.h`.

As a standard solution, MySQL exposes DBUG package and various macros
associated with it.

This set of changes makes sure that every call to any of the functions
MyRocks implements will be tracked with a pair of `DBUG_FUNC_CALL` and
`DBUG_RETURN*` macros. We can now change DBUG settings during runtime
(`SET GLOBAL debug = '+d,enter,exit:L';` or something similar) and
observe the execution flow.

`DBUG_FUNC_CALL` is a simple customization based on `DBUG_ENTER` and it
uses `__PRETTY_FUNCTION__` to delegate the work of composing correct
function names to a compiler. Yes, this functionality is specific to
`Clang` or `GCC` and these are the only toolsets we care about now.

For future references: please use
Closes facebook/mysql-5.6#500

Reviewed By: lth

Differential Revision: D4391700

Pulled By: gunnarku

fbshipit-source-id: 56f2c001f56
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 15, 2021
…ercona#500)

Summary:
Interface MySQL provides for implementing custom storage engines is
quite cumbersome. For the purposes of the debugging and understanding
the flow of execution we need to be able to clearly observe and trace
how MyRocks code is being called. Interface itself is described in
`sql\handler.h`.

As a standard solution, MySQL exposes DBUG package and various macros
associated with it.

This set of changes makes sure that every call to any of the functions
MyRocks implements will be tracked with a pair of `DBUG_FUNC_CALL` and
`DBUG_RETURN*` macros. We can now change DBUG settings during runtime
(`SET GLOBAL debug = '+d,enter,exit:L';` or something similar) and
observe the execution flow.

`DBUG_FUNC_CALL` is a simple customization based on `DBUG_ENTER` and it
uses `__PRETTY_FUNCTION__` to delegate the work of composing correct
function names to a compiler. Yes, this functionality is specific to
`Clang` or `GCC` and these are the only toolsets we care about now.

For future references: please use
Closes facebook/mysql-5.6#500

Reviewed By: lloyd

Differential Revision: D4391700 (facebook/mysql-5.6@d72c1b0)

Pulled By: gunnarku

fbshipit-source-id: 5be721c0bc8
ldonoso pushed a commit to ldonoso/percona-server that referenced this pull request Mar 15, 2022
…ercona#500)

Summary:
Interface MySQL provides for implementing custom storage engines is
quite cumbersome. For the purposes of the debugging and understanding
the flow of execution we need to be able to clearly observe and trace
how MyRocks code is being called. Interface itself is described in
`sql\handler.h`.

As a standard solution, MySQL exposes DBUG package and various macros
associated with it.

This set of changes makes sure that every call to any of the functions
MyRocks implements will be tracked with a pair of `DBUG_FUNC_CALL` and
`DBUG_RETURN*` macros. We can now change DBUG settings during runtime
(`SET GLOBAL debug = '+d,enter,exit:L';` or something similar) and
observe the execution flow.

`DBUG_FUNC_CALL` is a simple customization based on `DBUG_ENTER` and it
uses `__PRETTY_FUNCTION__` to delegate the work of composing correct
function names to a compiler. Yes, this functionality is specific to
`Clang` or `GCC` and these are the only toolsets we care about now.

For future references: please use
Closes facebook/mysql-5.6#500

Reviewed By: lloyd

Differential Revision: D4391700

Pulled By: gunnarku
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 9, 2024
…ercona#500)

Summary:
Interface MySQL provides for implementing custom storage engines is
quite cumbersome. For the purposes of the debugging and understanding
the flow of execution we need to be able to clearly observe and trace
how MyRocks code is being called. Interface itself is described in
`sql\handler.h`.

As a standard solution, MySQL exposes DBUG package and various macros
associated with it.

This set of changes makes sure that every call to any of the functions
MyRocks implements will be tracked with a pair of `DBUG_FUNC_CALL` and
`DBUG_RETURN*` macros. We can now change DBUG settings during runtime
(`SET GLOBAL debug = '+d,enter,exit:L';` or something similar) and
observe the execution flow.

`DBUG_FUNC_CALL` is a simple customization based on `DBUG_ENTER` and it
uses `__PRETTY_FUNCTION__` to delegate the work of composing correct
function names to a compiler. Yes, this functionality is specific to
`Clang` or `GCC` and these are the only toolsets we care about now.

For future references: please use
Closes facebook/mysql-5.6#500

Reviewed By: lloyd

Differential Revision: D4391700

Pulled By: gunnarku
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants