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
602d3daf
Commit
602d3daf
authored
Aug 11, 2020
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-23279 postfix - delay accepting connections until server startup is finished.
parent
6a7e646d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
sql/handle_connections_win.cc
sql/handle_connections_win.cc
+14
-15
No files found.
sql/handle_connections_win.cc
View file @
602d3daf
...
...
@@ -319,7 +319,7 @@ struct Pipe_Listener : public Listener
{
PTP_CALLBACK_ENVIRON
m_tp_env
;
Pipe_Listener
()
:
Listener
(
INVALID_HANDLE_VALUE
,
CreateEvent
(
0
,
FALSE
,
FALSE
,
0
)),
Listener
(
create_named_pipe
()
,
CreateEvent
(
0
,
FALSE
,
FALSE
,
0
)),
m_tp_env
(
get_threadpool_win_callback_environ
())
{
}
...
...
@@ -388,7 +388,6 @@ struct Pipe_Listener : public Listener
void
begin_accept
()
{
m_handle
=
create_named_pipe
();
BOOL
connected
=
ConnectNamedPipe
(
m_handle
,
&
m_overlapped
);
if
(
connected
)
{
...
...
@@ -433,11 +432,12 @@ struct Pipe_Listener : public Listener
sql_print_warning
(
"ConnectNamedPipe completed with %u"
,
GetLastError
());
#endif
CloseHandle
(
m_handle
);
m_handle
=
INVALID_HANDLE_VALUE
;
m_handle
=
create_named_pipe
()
;
begin_accept
();
return
;
}
HANDLE
pipe
=
m_handle
;
m_handle
=
create_named_pipe
();
begin_accept
();
// If threadpool is on, create connection in threadpool thread
if
(
!
m_tp_env
||
!
TrySubmitThreadpoolCallback
(
tp_create_pipe_connection
,
pipe
,
m_tp_env
))
...
...
@@ -485,7 +485,6 @@ struct Pipe_Listener : public Listener
static
Listener
*
all_listeners
[
MAX_WAIT_HANDLES
];
static
HANDLE
wait_events
[
MAX_WAIT_HANDLES
];
static
int
n_listeners
;
static
int
n_waits
;
void
network_init_win
()
{
...
...
@@ -517,27 +516,27 @@ void network_init_win()
sql_print_error
(
"Either TCP connections or named pipe connections must be enabled."
);
unireg_abort
(
1
);
}
}
void
handle_connections_win
()
{
DBUG_ASSERT
(
hEventShutdown
);
int
n_waits
;
n_waits
=
1
;
wait_events
[
SHUTDOWN_IDX
]
=
hEventShutdown
;
n_waits
=
1
;
for
(
int
i
=
0
;
i
<
n_listeners
;
i
++
)
for
(
int
i
=
0
;
i
<
n_listeners
;
i
++
)
{
HANDLE
wait_handle
=
all_listeners
[
i
]
->
wait_handle
();
if
(
wait_handle
)
if
(
wait_handle
)
{
DBUG_ASSERT
((
i
==
0
)
||
(
all_listeners
[
i
-
1
]
->
wait_handle
()
!=
0
));
DBUG_ASSERT
((
i
==
0
)
||
(
all_listeners
[
i
-
1
]
->
wait_handle
()
!=
0
));
wait_events
[
n_waits
++
]
=
wait_handle
;
}
all_listeners
[
i
]
->
begin_accept
();
}
}
void
handle_connections_win
()
{
DBUG_ASSERT
(
hEventShutdown
);
DBUG_ASSERT
(
n_waits
);
wait_events
[
SHUTDOWN_IDX
]
=
hEventShutdown
;
for
(;;)
{
DWORD
idx
=
WaitForMultipleObjects
(
n_waits
,
wait_events
,
FALSE
,
INFINITE
);
...
...
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