[omd-commits] OMD Git: omd: gearman: fix client connection handling issue
git version control
git at mathias-kettner.de
Fri Jun 7 15:39:44 CEST 2013
Module: omd
Branch: master
Commit: 6c7871f6ebb98e9c8791fcf777b0888bc019fee2
URL: http://omdistro.org/projects/omd/repository/revisions/6c7871f6ebb98e9c8791fcf777b0888bc019fee2
Author: Sven Nierlein <sven at nierlein.de>
Date: Thu Jun 6 16:08:51 2013 +0200
Commiter: Sven Nierlein <sven at consol.de>
Date: Thu Jun 6 18:26:45 2013 +0200
gearman: fix client connection handling issue
---
.../0003-fix-client-connection-handling.patch | 75 ++++++++++++++++++++
packages/gearmand/patches/README | 8 +++
2 files changed, 83 insertions(+)
diff --git a/packages/gearmand/patches/0003-fix-client-connection-handling.patch b/packages/gearmand/patches/0003-fix-client-connection-handling.patch
new file mode 100644
index 0000000..5f6f7c6
--- /dev/null
+++ b/packages/gearmand/patches/0003-fix-client-connection-handling.patch
@@ -0,0 +1,75 @@
+--- a/libgearman/client.cc 2012-05-04 05:51:48.000000000 +0200
++++ b/libgearman/client.cc 2013-06-06 16:02:19.223730770 +0200
+@@ -1308,11 +1308,7 @@
+
+ if (client->new_tasks == 0)
+ {
+- gearman_return_t local_ret= gearman_flush_all(client->universal);
+- if (gearman_failed(local_ret))
+- {
+- return local_ret;
+- }
++ gearman_flush_all(client->universal);
+ }
+ }
+
+--- a/libgearman/universal.cc 2012-05-04 05:51:48.000000000 +0200
++++ b/libgearman/universal.cc 2013-06-06 16:02:19.223730770 +0200
+@@ -233,7 +233,12 @@
+ }
+ }
+
+-gearman_return_t gearman_flush_all(gearman_universal_st& universal)
++/*
++ * Flush all shouldn't return any error, because there's no way to indicate
++ * which connection experienced an issue. Error detection is better done in gearman_wait()
++ * after flushing all the connections here.
++ */
++void gearman_flush_all(gearman_universal_st& universal)
+ {
+ for (gearman_connection_st *con= universal.con_list; con; con= con->next)
+ {
+@@ -242,14 +247,8 @@
+ continue;
+ }
+
+- gearman_return_t ret= con->flush();
+- if (gearman_failed(ret) and ret != GEARMAN_IO_WAIT)
+- {
+- return ret;
+- }
++ con->flush();
+ }
+-
+- return GEARMAN_SUCCESS;
+ }
+
+ gearman_return_t gearman_wait(gearman_universal_st& universal)
+--- a/libgearman/universal.hpp 2012-05-04 05:51:48.000000000 +0200
++++ b/libgearman/universal.hpp 2013-06-06 16:02:19.223730770 +0200
+@@ -77,7 +77,7 @@
+
+ // Flush the send buffer for all connections.
+ GEARMAN_LOCAL
+-gearman_return_t gearman_flush_all(gearman_universal_st&);
++void gearman_flush_all(gearman_universal_st&);
+
+ /**
+ * Set custom memory allocation function for workloads. Normally gearman uses
+--- a/libgearman/connection.cc 2012-05-04 05:51:48.000000000 +0200
++++ b/libgearman/connection.cc 2013-06-06 16:02:19.227730820 +0200
+@@ -390,6 +390,14 @@
+
+ recv_buffer_ptr= recv_buffer;
+ recv_buffer_size= 0;
++
++ // created_id_next is incremented for every outbound packet (except status).
++ // created_id is incremented for every response packet received, and also when
++ // no packets are received due to an error. There are lots of such error paths
++ // and it seems simpler to just reset these both to zero when a connection is
++ // 'closed'.
++ created_id= 0;
++ created_id_next= 0;
+ }
+
+ void gearman_connection_st::free_recv_packet()
diff --git a/packages/gearmand/patches/README b/packages/gearmand/patches/README
index bc783af..45155e5 100644
--- a/packages/gearmand/patches/README
+++ b/packages/gearmand/patches/README
@@ -1,3 +1,11 @@
+0001:
+Removes compiling test cases which break on some systems. This also
+speeds up the build process.
+
0002:
Fixes compilation of gearmand on several platforms, like eg Ubuntu 12.10.
See issue 289 for reference, http://omdistro.org/issues/289.
+
+0003:
+Fix issue with clients connecting to multiple servers.
+See https://bugs.launchpad.net/gearmand/+bug/1098409
More information about the omd-commits
mailing list