aboutsummaryrefslogtreecommitdiff
path: root/parser-specs
diff options
context:
space:
mode:
authorOrestis Floros <orestisf1993@gmail.com>2018-04-23 12:20:05 +0300
committerOrestis Floros <orestisf1993@gmail.com>2018-08-08 19:14:56 +0300
commit37d0105c8328f718740c2ae9bae0dff87287a467 (patch)
tree627147496e01133597919db0eaa27999891e9f46 /parser-specs
parentb0bbe53d0404d600b29aa40671aadc2874c4ea50 (diff)
downloadi3-37d0105c8328f718740c2ae9bae0dff87287a467.tar.gz
i3-37d0105c8328f718740c2ae9bae0dff87287a467.zip
Kill misbehaving subscribed clients instead of hanging
This change only affects clients that are subscribed to events, which should be the main cause of our problems. In the common case (no buffered data) the behaviour doesn't change at all: the message is sent directly, no ev_io / ev_timeout callback is enabled. Once a write to a client's socket is not completed fully (returns with EAGAIN error), we put the message in the tail of a queue and init an ev_io callback and a corresponding timer. If the timer is triggered first, the socket is closed and the client connection is removed. If the socket becomes writeable before the timeout we either reset the timer if we couldn't push all the buffered data or completely remove it if everything was pushed. We could also replace ipc_send_message() for all client connections in i3, not just those subscribed to events. Furthermore, we could limit the amount of messages stored and increase the timeout (or use multiple timeouts): eg it's ok if a client is not reading for 10 seconds and we are only holding 5KB of messages for them but it is not ok if they are inactive for 5 seconds and we have 30MB of messages held. Closes #2999 Closes #2539
Diffstat (limited to 'parser-specs')
-rw-r--r--parser-specs/config.spec6
1 files changed, 6 insertions, 0 deletions
diff --git a/parser-specs/config.spec b/parser-specs/config.spec
index b15c9a80..5cdb7c32 100644
--- a/parser-specs/config.spec
+++ b/parser-specs/config.spec
@@ -48,6 +48,7 @@ state INITIAL:
'show_marks' -> SHOW_MARKS
'workspace' -> WORKSPACE
'ipc_socket', 'ipc-socket' -> IPC_SOCKET
+ 'ipc_kill_timeout' -> IPC_KILL_TIMEOUT
'restart_state' -> RESTART_STATE
'popup_during_fullscreen' -> POPUP_DURING_FULLSCREEN
exectype = 'exec_always', 'exec' -> EXEC
@@ -281,6 +282,11 @@ state IPC_SOCKET:
path = string
-> call cfg_ipc_socket($path)
+# ipc_kill_timeout
+state IPC_KILL_TIMEOUT:
+ timeout = number
+ -> call cfg_ipc_kill_timeout(&timeout)
+
# restart_state <path> (for testcases)
state RESTART_STATE:
path = string