Below is the list of changes that have just been committed into a local
4.1 repository of tomash. When tomash does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-08-06 15:03:03+04:00, kroki@stripped +2 -0
BUG#9678: Client library hangs after network communication failure
Socket timeouts in client library were used only on Windows.
The solution is to use socket timeouts in client library on all
systems were they are supported.
No test case is provided because it is impossible to simulate network
failure in current test suit.
sql/net_serv.cc@stripped, 2006-08-06 15:02:59+04:00, kroki@stripped +1 -1
Retry indefinitely only if got EINTR.
vio/viosocket.c@stripped, 2006-08-06 15:02:59+04:00, kroki@stripped +20 -8
Set socket timeouts on POSIX systems as well as on Windows.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: kroki
# Host: moonlight.intranet
# Root: /home/tomash/src/mysql_ab/mysql-4.1-bug9678
--- 1.75/sql/net_serv.cc 2006-08-06 15:03:09 +04:00
+++ 1.76/sql/net_serv.cc 2006-08-06 15:03:09 +04:00
@@ -747,7 +747,7 @@ my_real_read(NET *net, ulong *complen)
#endif /* EXTRA_DEBUG */
}
#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER)
- if (vio_should_retry(net->vio))
+ if (vio_errno(net->vio) == SOCKET_EINTR)
{
DBUG_PRINT("warning",("Interrupted read. Retrying..."));
continue;
--- 1.35/vio/viosocket.c 2006-08-06 15:03:09 +04:00
+++ 1.36/vio/viosocket.c 2006-08-06 15:03:09 +04:00
@@ -333,16 +333,28 @@ my_bool vio_poll_read(Vio *vio,uint time
}
-void vio_timeout(Vio *vio __attribute__((unused)),
- uint which __attribute__((unused)),
- uint timeout __attribute__((unused)))
+void vio_timeout(Vio *vio, uint which, uint timeout)
{
+#if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO)
+
#ifdef __WIN__
- ulong wait_timeout= (ulong) timeout * 1000;
- (void) setsockopt(vio->sd, SOL_SOCKET,
- which ? SO_SNDTIMEO : SO_RCVTIMEO, (char*) &wait_timeout,
- sizeof(wait_timeout));
-#endif /* __WIN__ */
+
+ /* Windows expect time in milliseconds as int. */
+ int wait_timeout= (int) timeout * 1000;
+
+#else /* ! __WIN__ */
+
+ /* POSIX specifies time as struct timeval. */
+ struct timeval wait_timeout;
+ wait_timeout.tv_sec= timeout;
+ wait_timeout.tv_usec= 0;
+
+#endif /* ! __WIN__ */
+
+ (void) setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
+ (char*) &wait_timeout, sizeof(wait_timeout));
+
+#endif /* defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO) */
}
| Thread |
|---|
| • bk commit into 4.1 tree (kroki:1.2530) BUG#9678 | kroki | 6 Aug |