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
commite080080711793006e26104a44838e1e5de806c78 (patch)
tree3622409abc8428690224f7377acc78c817842320 /include/violite.h
parent6e4039ce673b82a9335350bc80539473ea0d4a55 (diff)
downloadmariadb-git-e080080711793006e26104a44838e1e5de806c78.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. include/violite.h: Add pipe_overlapped to Vio structure for async IO for named pipes. sql-common/client.c: Use asynchronous pipe IO. sql/mysqld.cc: Use asynchronous pipe IO. vio/vio.c: -Refactor timeouts for win32 protocols: shared memory and named pipes. Store read/write timeout in VIO structure, instead of storing pointer to NET. New function vio_win32_timeout called indirectly via vio_timeout changes these values. vio/vio_priv.h: Remove vio_ignore_timeout. Add vio_win32_timeout to be used for named pipes and shared memory. vio/viosocket.c: Use async IO for named pipes. After issuing IO, wait for either IO completion, pipe_close_event or timeout. Refactor timeouts for named pipe and shared memory.
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_ */