summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/pseudo')
-rw-r--r--meta/recipes-devtools/pseudo/files/fastopreply.patch76
-rw-r--r--meta/recipes-devtools/pseudo/files/toomanyfiles.patch9
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_1.8.2.bb1
3 files changed, 80 insertions, 6 deletions
diff --git a/meta/recipes-devtools/pseudo/files/fastopreply.patch b/meta/recipes-devtools/pseudo/files/fastopreply.patch
new file mode 100644
index 0000000000..904c2d04e6
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/fastopreply.patch
@@ -0,0 +1,76 @@
1Ensure FASTOP messages get an ACK reply so that the client can be sure the server
2recieved them. This means if connections are terminated, data isn't lost.
3
4RP 2017/9/22
5
6Upstream-Status: Submitted
7
8Index: pseudo-1.8.2/pseudo_client.c
9===================================================================
10--- pseudo-1.8.2.orig/pseudo_client.c
11+++ pseudo-1.8.2/pseudo_client.c
12@@ -1331,21 +1331,19 @@ pseudo_client_request(pseudo_msg_t *msg,
13 * indicating a successful send.
14 */
15 pseudo_debug(PDBGF_CLIENT | PDBGF_VERBOSE, "sent!\n");
16- if (msg->type != PSEUDO_MSG_FASTOP) {
17- response = pseudo_msg_receive(connect_fd);
18- if (!response) {
19- pseudo_debug(PDBGF_CLIENT, "expected response did not occur; retrying\n");
20+ response = pseudo_msg_receive(connect_fd);
21+ if (!response) {
22+ pseudo_debug(PDBGF_CLIENT, "expected response did not occur; retrying\n");
23+ } else {
24+ if (response->type != PSEUDO_MSG_ACK) {
25+ pseudo_debug(PDBGF_CLIENT, "got non-ack response %d\n", response->type);
26+ return 0;
27+ } else if (msg->type != PSEUDO_MSG_FASTOP) {
28+ pseudo_debug(PDBGF_CLIENT | PDBGF_VERBOSE, "got response type %d\n", response->type);
29+ return response;
30 } else {
31- if (response->type != PSEUDO_MSG_ACK) {
32- pseudo_debug(PDBGF_CLIENT, "got non-ack response %d\n", response->type);
33- return 0;
34- } else {
35- pseudo_debug(PDBGF_CLIENT | PDBGF_VERBOSE, "got response type %d\n", response->type);
36- return response;
37- }
38+ return 0;
39 }
40- } else {
41- return 0;
42 }
43 }
44 pseudo_diag("pseudo: server connection persistently failed, aborting.\n");
45Index: pseudo-1.8.2/pseudo_server.c
46===================================================================
47--- pseudo-1.8.2.orig/pseudo_server.c
48+++ pseudo-1.8.2/pseudo_server.c
49@@ -463,6 +463,11 @@ close_client(int client) {
50 --highest_client;
51 }
52
53+static pseudo_msg_t server_fastop_reply = {
54+ .type = PSEUDO_MSG_ACK,
55+ .op = OP_NONE,
56+};
57+
58 /* Actually process a request.
59 */
60 static int
61@@ -515,8 +520,14 @@ serve_client(int i) {
62 * pseudo_server_response.
63 */
64 if (in->type != PSEUDO_MSG_SHUTDOWN) {
65- if (in->type == PSEUDO_MSG_FASTOP)
66+ if (in->type == PSEUDO_MSG_FASTOP) {
67 send_response = 0;
68+ /* For fastops we reply now to say we got the data */
69+ if ((rc = pseudo_msg_send(clients[i].fd, &server_fastop_reply, 0, NULL)) != 0) {
70+ pseudo_debug(PDBGF_SERVER, "failed to send fastop ack to client %d [%d]: %d (%s)\n",
71+ i, (int) clients[i].pid, rc, strerror(errno));
72+ }
73+ }
74 /* most messages don't need these, but xattr may */
75 response_path = 0;
76 response_pathlen = -1;
diff --git a/meta/recipes-devtools/pseudo/files/toomanyfiles.patch b/meta/recipes-devtools/pseudo/files/toomanyfiles.patch
index 7319ab29bf..b085a4505d 100644
--- a/meta/recipes-devtools/pseudo/files/toomanyfiles.patch
+++ b/meta/recipes-devtools/pseudo/files/toomanyfiles.patch
@@ -9,7 +9,7 @@ a small risk of data loss here sadly but its better than hanging.
9RP 9RP
102017/4/25 102017/4/25
11 11
12Upstream-Status: Pending [Peter is aware of the issue] 12Upstream-Status: Submitted [Peter is aware of the issue]
13 13
14Index: pseudo-1.8.2/pseudo_server.c 14Index: pseudo-1.8.2/pseudo_server.c
15=================================================================== 15===================================================================
@@ -31,15 +31,12 @@ Index: pseudo-1.8.2/pseudo_server.c
31 31
32 pseudo_debug(PDBGF_SERVER, "server loop started.\n"); 32 pseudo_debug(PDBGF_SERVER, "server loop started.\n");
33 if (listen_fd < 0) { 33 if (listen_fd < 0) {
34@@ -663,10 +665,18 @@ pseudo_server_loop(void) { 34@@ -663,10 +665,15 @@ pseudo_server_loop(void) {
35 message_time.tv_usec -= 1000000; 35 message_time.tv_usec -= 1000000;
36 ++message_time.tv_sec; 36 ++message_time.tv_sec;
37 } 37 }
38+ } else if (hitmaxfiles) { 38+ } else if (hitmaxfiles) {
39+ /* In theory there is a potential race here where if we close a client, 39+ /* Only close one per loop iteration in the interests of caution */
40+ it may have sent us a fastop message which we don't act upon.
41+ If we don't close a filehandle we'll loop indefinitely thought.
42+ Only close one per loop iteration in the interests of caution */
43+ close_client(i); 40+ close_client(i);
44+ hitmaxfiles = 0; 41+ hitmaxfiles = 0;
45 } 42 }
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb b/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb
index 81853e95c4..73ef57231a 100644
--- a/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb
@@ -7,6 +7,7 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz
7 file://moreretries.patch \ 7 file://moreretries.patch \
8 file://efe0be279901006f939cd357ccee47b651c786da.patch \ 8 file://efe0be279901006f939cd357ccee47b651c786da.patch \
9 file://b6b68db896f9963558334aff7fca61adde4ec10f.patch \ 9 file://b6b68db896f9963558334aff7fca61adde4ec10f.patch \
10 file://fastopreply.patch \
10 file://toomanyfiles.patch \ 11 file://toomanyfiles.patch \
11 file://0001-Use-epoll-API-on-Linux.patch \ 12 file://0001-Use-epoll-API-on-Linux.patch \
12 " 13 "