summaryrefslogtreecommitdiff
path: root/include/violite.h
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-11-02 23:19:58 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-11-02 23:19:58 +0100
commit84301e8b9d8e3e8a658ecfed9d7f1ceb7a9f05fe (patch)
tree3622409abc8428690224f7377acc78c817842320 /include/violite.h
parentbf711a743ec1d049a65ce3dda47c1e0a88581ab1 (diff)
downloadmariadb-git-84301e8b9d8e3e8a658ecfed9d7f1ceb7a9f05fe.tar.gz
Bug#47571: idle named pipe connection is unkillable
Bug#31621: Windows server hanging during shutdown using named pipes and idle connection Problem: when idle pipe connection is forcefully closed with KILL statement or when the server goes down, thread that is closing connection would hang infinitely in CloseHandle(). The reason for the hang is that named pipe operations are performed synchronously. In this mode all IOs on pipe are serialized, that is CloseHandle() will not abort ReadFile() in another thread, but wait for ReadFile() to complete. The fix implements asynchrnous mode for named pipes, where operation of file are not synchronized. Read/Write operation would fire an async IO and wait for either IO completion or timeout. Note, that with this patch timeouts are properly handled for named pipes. Post-review: Win32 timeout code has been fixed for named pipes and shared memory. We do not store pointer to NET in vio structure, only the read and write timeouts.
Diffstat (limited to 'include/violite.h')
-rw-r--r--include/violite.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/violite.h b/include/violite.h
index f833606233c..3f68ccde10f 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -44,7 +44,7 @@ enum enum_vio_type
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
#ifdef __WIN__
Vio* vio_new_win32pipe(HANDLE hPipe);
-Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map,
+Vio* vio_new_win32shared_memory(HANDLE handle_file_map,
HANDLE handle_map,
HANDLE event_server_wrote,
HANDLE event_server_read,
@@ -221,7 +221,11 @@ struct st_vio
HANDLE event_conn_closed;
size_t shared_memory_remain;
char *shared_memory_pos;
- NET *net;
#endif /* HAVE_SMEM */
+#ifdef _WIN32
+ OVERLAPPED pipe_overlapped;
+ DWORD read_timeout_millis;
+ DWORD write_timeout_millis;
+#endif
};
#endif /* vio_violite_h_ */