mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
fix(rpc): avoid hang when requests race a dying rpc-server
Requests now register before testing for shutdown, so either the reader loop or the caller answers them. Also failed start() winds down its threads, ignoring a broken pipe on stdin.
This commit is contained in:
@@ -746,6 +746,11 @@ def test_early_failure(tmp_path) -> None:
|
||||
with pytest.raises(JsonRpcError, match="invalid_dir"):
|
||||
rpc.start()
|
||||
|
||||
# Requests issued after the server exited must fail immediately
|
||||
# instead of waiting forever for the finished reader loop.
|
||||
with pytest.raises(JsonRpcError, match="RPC server closed"):
|
||||
rpc.get_system_info()
|
||||
|
||||
|
||||
def test_mdn_doesnt_break_autocrypt(acf) -> None:
|
||||
alice, bob = acf.get_online_accounts(2)
|
||||
|
||||
Reference in New Issue
Block a user