diff options
| author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2018-03-01 15:53:46 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-04 11:35:41 +0000 |
| commit | d50b9c511e17c6f582ef39b61eaaa8d4555eabba (patch) | |
| tree | 794a20e7d91cc313086994a2c73bb81dddf363dc /meta/recipes-devtools/pseudo/files/toomanyfiles.patch | |
| parent | f0a5815732f3e62da51fbb89d35c2fbee84aac0f (diff) | |
| download | poky-d50b9c511e17c6f582ef39b61eaaa8d4555eabba.tar.gz | |
pseudo: update to latest master
Dropped patches:
0001-Use-epoll-API-on-Linux.patch replaced by
http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/commit/?id=0a3e435085046f535074f498a3de75a7704fb14c
(also add --enable-epoll to configure options)
b6b68db896f9963558334aff7fca61adde4ec10f.patch merged upstream
efe0be279901006f939cd357ccee47b651c786da.patch merged upstream
fastopreply.patch replaced by
http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/commit/?id=449c234d3030328fb997b309511bb54598848a05
toomanyfiles.patch rebased
(From OE-Core rev: 7c3df6782bbd5b623dcb6ee8a9bc914926640cdd)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/pseudo/files/toomanyfiles.patch')
| -rw-r--r-- | meta/recipes-devtools/pseudo/files/toomanyfiles.patch | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/meta/recipes-devtools/pseudo/files/toomanyfiles.patch b/meta/recipes-devtools/pseudo/files/toomanyfiles.patch index b085a4505d..bda7e4b202 100644 --- a/meta/recipes-devtools/pseudo/files/toomanyfiles.patch +++ b/meta/recipes-devtools/pseudo/files/toomanyfiles.patch | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | From b0b25fbc041a148d1de09f5a6503cd95973ec77c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
| 3 | Date: Tue, 25 Apr 2017 15:25:54 +0100 | ||
| 4 | Subject: [PATCH 3/3] pseudo: Handle too many files deadlock | ||
| 5 | |||
| 1 | Currently if we max out the maximum number of files, pseudo can deadlock, unable to | 6 | Currently if we max out the maximum number of files, pseudo can deadlock, unable to |
| 2 | accept new connections yet unable to move forward and unblock the other processes | 7 | accept new connections yet unable to move forward and unblock the other processes |
| 3 | waiting either. | 8 | waiting either. |
| @@ -11,19 +16,23 @@ RP | |||
| 11 | 16 | ||
| 12 | Upstream-Status: Submitted [Peter is aware of the issue] | 17 | Upstream-Status: Submitted [Peter is aware of the issue] |
| 13 | 18 | ||
| 14 | Index: pseudo-1.8.2/pseudo_server.c | 19 | --- |
| 15 | =================================================================== | 20 | pseudo_server.c | 10 ++++++++++ |
| 16 | --- pseudo-1.8.2.orig/pseudo_server.c | 21 | 1 file changed, 10 insertions(+) |
| 17 | +++ pseudo-1.8.2/pseudo_server.c | 22 | |
| 18 | @@ -581,6 +581,7 @@ pseudo_server_loop(void) { | 23 | diff --git a/pseudo_server.c b/pseudo_server.c |
| 19 | int rc; | 24 | index dac3258..15a3e8f 100644 |
| 20 | int fd; | 25 | --- a/pseudo_server.c |
| 21 | int loop_timeout = pseudo_server_timeout; | 26 | +++ b/pseudo_server.c |
| 27 | @@ -802,6 +802,7 @@ pseudo_server_loop(void) { | ||
| 28 | struct sigaction eat_usr2 = { | ||
| 29 | .sa_handler = set_do_list_clients | ||
| 30 | }; | ||
| 22 | + int hitmaxfiles; | 31 | + int hitmaxfiles; |
| 23 | 32 | ||
| 24 | clients = malloc(16 * sizeof(*clients)); | 33 | clients = malloc(16 * sizeof(*clients)); |
| 25 | 34 | ||
| 26 | @@ -597,6 +598,7 @@ pseudo_server_loop(void) { | 35 | @@ -820,6 +821,7 @@ pseudo_server_loop(void) { |
| 27 | active_clients = 1; | 36 | active_clients = 1; |
| 28 | max_clients = 16; | 37 | max_clients = 16; |
| 29 | highest_client = 0; | 38 | highest_client = 0; |
| @@ -31,9 +40,9 @@ Index: pseudo-1.8.2/pseudo_server.c | |||
| 31 | 40 | ||
| 32 | pseudo_debug(PDBGF_SERVER, "server loop started.\n"); | 41 | pseudo_debug(PDBGF_SERVER, "server loop started.\n"); |
| 33 | if (listen_fd < 0) { | 42 | if (listen_fd < 0) { |
| 34 | @@ -663,10 +665,15 @@ pseudo_server_loop(void) { | 43 | @@ -878,10 +880,15 @@ pseudo_server_loop(void) { |
| 35 | message_time.tv_usec -= 1000000; | 44 | } else { |
| 36 | ++message_time.tv_sec; | 45 | serve_client(i); |
| 37 | } | 46 | } |
| 38 | + } else if (hitmaxfiles) { | 47 | + } else if (hitmaxfiles) { |
| 39 | + /* Only close one per loop iteration in the interests of caution */ | 48 | + /* Only close one per loop iteration in the interests of caution */ |
| @@ -47,13 +56,16 @@ Index: pseudo-1.8.2/pseudo_server.c | |||
| 47 | if (!die_forcefully && | 56 | if (!die_forcefully && |
| 48 | (FD_ISSET(clients[0].fd, &events) || | 57 | (FD_ISSET(clients[0].fd, &events) || |
| 49 | FD_ISSET(clients[0].fd, &reads))) { | 58 | FD_ISSET(clients[0].fd, &reads))) { |
| 50 | @@ -688,6 +698,9 @@ pseudo_server_loop(void) { | 59 | @@ -903,6 +910,9 @@ pseudo_server_loop(void) { |
| 51 | */ | 60 | */ |
| 52 | pseudo_server_timeout = DEFAULT_PSEUDO_SERVER_TIMEOUT; | 61 | pseudo_server_timeout = DEFAULT_PSEUDO_SERVER_TIMEOUT; |
| 53 | die_peacefully = 0; | 62 | die_peacefully = 0; |
| 54 | + } else if (errno == EMFILE) { | 63 | + } else if (errno == EMFILE) { |
| 55 | + hitmaxfiles = 1; | 64 | + hitmaxfiles = 1; |
| 56 | + pseudo_debug(PDBGF_SERVER, "Hit max open files, dropping a client.\n"); | 65 | + pseudo_debug(PDBGF_SERVER, "Hit max open files, dropping a client.\n"); |
| 57 | } | 66 | } |
| 58 | } | 67 | } |
| 59 | pseudo_debug(PDBGF_SERVER, "server loop complete [%d clients left]\n", active_clients); | 68 | pseudo_debug(PDBGF_SERVER, "server loop complete [%d clients left]\n", active_clients); |
| 69 | -- | ||
| 70 | 2.15.1 | ||
| 71 | |||
