Websocket: Close onloop during Terminate()

Terminate() is called when Zeek shuts down. If WebSocket client threads
were blocked in QueueForProcessing() due to reaching queue limits, these
previously would not exit QueueForProcessing() and instead block
indefinitely, resulting in the ixwebsocket library blocking and its
garbage collection thread running at 100%. Not great.

Closing the onloop instance will unblock the WebSocket client threads
for a timely shutdown.

Closes #4420
This commit is contained in:
Arne Welzel 2025-05-06 11:53:15 +02:00
parent 6ebec6dde7
commit bb06af601f
6 changed files with 115 additions and 0 deletions

View file

@ -0,0 +1 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.

View file

@ -0,0 +1,4 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
connection closed ok
connection closed ok
connection closed ok

View file

@ -0,0 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
received termination signal

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
B Cluster::websocket_client_added, [/zeek/wstest/ws1/]
B Cluster::websocket_client_added, [/zeek/wstest/ws2/]
B Cluster::websocket_client_added, [/zeek/wstest/ws3/]
D got 1000 pings from 3 clients, terminating