Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
351026ca
Commit
351026ca
authored
Mar 09, 2016
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix threadpool memory leak and connect2 test
parent
f12229f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
2 deletions
+11
-2
mysql-test/r/connect2.result
mysql-test/r/connect2.result
+1
-0
mysql-test/t/connect2.test
mysql-test/t/connect2.test
+1
-1
sql/threadpool_common.cc
sql/threadpool_common.cc
+7
-1
sql/threadpool_unix.cc
sql/threadpool_unix.cc
+1
-0
sql/threadpool_win.cc
sql/threadpool_win.cc
+1
-0
No files found.
mysql-test/r/connect2.result
View file @
351026ca
call mtr.add_suppression("Allocation failed");
SET @old_debug= @@session.debug;
set @old_thread_cache_size=@@global.thread_cache_size;
select 1;
...
...
mysql-test/t/connect2.test
View file @
351026ca
...
...
@@ -4,7 +4,7 @@
# This test makes no sense with the embedded server
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_debug
.
inc
call
mtr
.
add_suppression
(
"Allocation failed"
);
SET
@
old_debug
=
@@
session
.
debug
;
set
@
old_thread_cache_size
=@@
global
.
thread_cache_size
;
...
...
sql/threadpool_common.cc
View file @
351026ca
...
...
@@ -122,13 +122,19 @@ THD* threadpool_add_connection(CONNECT *connect, void *scheduler_data)
pthread_setspecific
(
THR_KEY_mysys
,
0
);
my_thread_init
();
st_my_thread_var
*
mysys_var
=
(
st_my_thread_var
*
)
pthread_getspecific
(
THR_KEY_mysys
);
DBUG_EXECUTE_IF
(
"simulate_failed_connection_1"
,
mysys_var
=
NULL
;
my_thread_end
(););
if
(
!
mysys_var
||!
(
thd
=
connect
->
create_thd
()))
{
/* Out of memory? */
connect
->
close_and_delete
();
if
(
mysys_var
)
{
#ifdef HAVE_PSI_INTERFACE
/*
current PSI is still from worker thread.
Set to 0, to avoid premature cleanup by my_thread_end
*/
if
(
PSI_server
)
PSI_server
->
set_thread
(
0
);
#endif
my_thread_end
();
}
worker_context
.
restore
();
...
...
sql/threadpool_unix.cc
View file @
351026ca
...
...
@@ -1235,6 +1235,7 @@ void tp_add_connection(CONNECT *connect)
connection
=
alloc_connection
();
if
(
!
connection
)
{
connect
->
close_and_delete
();
DBUG_VOID_RETURN
;
}
connection
->
connect
=
connect
;
...
...
sql/threadpool_win.cc
View file @
351026ca
...
...
@@ -663,6 +663,7 @@ void tp_add_connection(CONNECT *connect)
{
connection_t
*
con
;
con
=
(
connection_t
*
)
malloc
(
sizeof
(
connection_t
));
DBUG_EXECUTE_IF
(
"simulate_failed_connection_1"
,
free
(
con
);
con
=
0
;
);
if
(
!
con
)
{
tp_log_warning
(
"Allocation failed"
,
"tp_add_connection"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment