check_oracle_health: update to 1.9
[omd.git] / packages / gearmand / patches / 0003-fix-client-connection-handling.patch
blob5f6f7c6edb31aa388288e32b9caa590808dc7632
1 --- a/libgearman/client.cc 2012-05-04 05:51:48.000000000 +0200
2 +++ b/libgearman/client.cc 2013-06-06 16:02:19.223730770 +0200
3 @@ -1308,11 +1308,7 @@
5 if (client->new_tasks == 0)
7 - gearman_return_t local_ret= gearman_flush_all(client->universal);
8 - if (gearman_failed(local_ret))
9 - {
10 - return local_ret;
11 - }
12 + gearman_flush_all(client->universal);
16 --- a/libgearman/universal.cc 2012-05-04 05:51:48.000000000 +0200
17 +++ b/libgearman/universal.cc 2013-06-06 16:02:19.223730770 +0200
18 @@ -233,7 +233,12 @@
22 -gearman_return_t gearman_flush_all(gearman_universal_st& universal)
23 +/*
24 + * Flush all shouldn't return any error, because there's no way to indicate
25 + * which connection experienced an issue. Error detection is better done in gearman_wait()
26 + * after flushing all the connections here.
27 + */
28 +void gearman_flush_all(gearman_universal_st& universal)
30 for (gearman_connection_st *con= universal.con_list; con; con= con->next)
32 @@ -242,14 +247,8 @@
33 continue;
36 - gearman_return_t ret= con->flush();
37 - if (gearman_failed(ret) and ret != GEARMAN_IO_WAIT)
38 - {
39 - return ret;
40 - }
41 + con->flush();
44 - return GEARMAN_SUCCESS;
47 gearman_return_t gearman_wait(gearman_universal_st& universal)
48 --- a/libgearman/universal.hpp 2012-05-04 05:51:48.000000000 +0200
49 +++ b/libgearman/universal.hpp 2013-06-06 16:02:19.223730770 +0200
50 @@ -77,7 +77,7 @@
52 // Flush the send buffer for all connections.
53 GEARMAN_LOCAL
54 -gearman_return_t gearman_flush_all(gearman_universal_st&);
55 +void gearman_flush_all(gearman_universal_st&);
57 /**
58 * Set custom memory allocation function for workloads. Normally gearman uses
59 --- a/libgearman/connection.cc 2012-05-04 05:51:48.000000000 +0200
60 +++ b/libgearman/connection.cc 2013-06-06 16:02:19.227730820 +0200
61 @@ -390,6 +390,14 @@
63 recv_buffer_ptr= recv_buffer;
64 recv_buffer_size= 0;
66 + // created_id_next is incremented for every outbound packet (except status).
67 + // created_id is incremented for every response packet received, and also when
68 + // no packets are received due to an error. There are lots of such error paths
69 + // and it seems simpler to just reset these both to zero when a connection is
70 + // 'closed'.
71 + created_id= 0;
72 + created_id_next= 0;
75 void gearman_connection_st::free_recv_packet()