Commit graph

17835 commits

Author SHA1 Message Date
Arne Welzel
d656728088 btest/zam: Fix ZAM baselines
Hmm, standard script execution ignores dunder functions I believe and
reports on the caller. Maybe we should do the same for ZAM.
2025-03-13 18:29:46 +01:00
Arne Welzel
5d9282fd96 cluster/zeromq: Fix unsubscription visibility
When two workers connect to zeek.cluster.worker, the central ZeroMQ
proxy would not propagate unsubscription information to other nodes
once they both left. Set ZMQ_XPUB_VERBOSER on the proxies XPUB socket
for visibility.
2025-03-13 16:36:38 +01:00
Arne Welzel
5ec8a0457b cluster/zeromq: redef Cluster::enable_global_pub_sub to true
ZeroMQ has global publish subscribe by default, so set that in
the zeromq/connect script.
2025-03-13 16:36:38 +01:00
Arne Welzel
8bd7bd0923 cluster: Populate broadcast_topics during zeek_init()
The topics themselves are redef'able now, but broadcast_topics would
contain the original values.
2025-03-13 16:36:38 +01:00
Arne Welzel
2a5b5bd7d7 testing/btest/cluster: Global publish subscribe test
Adds a test that runs ZeroMQ and Broker sending events across all node
types to test global publish subscribe functionality.
2025-03-13 16:36:35 +01:00
Arne Welzel
f8ed62cae5 experimental/cluster_started: Support fully connected clusters
For ZeroMQ or a fully connected Broker, await node_up events from all
nodes in a cluster instead of relying on broker specific connection
establishment.

Also switch from Broker:: to Cluster::.
2025-03-13 16:34:02 +01:00
Arne Welzel
2fde2f18d6 cluster/setup-connections: Support global publish subscribe
Relates to #3917
2025-03-13 16:34:02 +01:00
zeek-bot
8a4041b776 Update doc submodule [nomail] [skip ci] 2025-03-13 00:13:10 +00:00
Arne Welzel
1b655836be Merge remote-tracking branch 'origin/topic/awelzel/ci-generate-docs-run-pre-commit'
* origin/topic/awelzel/ci-generate-docs-run-pre-commit:
  github/generate-docs: Run pre-commit
  cluster/backends/zeromq: Fix rst link in docs
2025-03-12 13:11:18 +01:00
Arne Welzel
e489b322e5 github/generate-docs: Run pre-commit
...it's a bit unfortunate that we cannot use the action for this. It's
because ./doc is a submodule and not the main repo.
2025-03-12 12:06:49 +01:00
Arne Welzel
cc0c48423d cluster/backends/zeromq: Fix rst link in docs 2025-03-12 10:11:25 +01:00
zeek-bot
f15281ab64 Update doc submodule [nomail] [skip ci] 2025-03-12 00:15:42 +00:00
Arne Welzel
bb58148c64 Merge remote-tracking branch 'origin/topic/awelzel/4136-cluster-websocket-support'
* origin/topic/awelzel/4136-cluster-websocket-support:
  ci/opensuse-tumpleweed: Bust cache
  ci/macos/prepare: Install python@3 explicitly
  cluster/websocket: Implement WebSocket server
  cluster/websocket: Add IXWebsocket submodule
  ci/alpine: Install openssl package for testing
  ci: Install websockets from pip for all distros
  auxil/libunistd: Bump for ssize_t typedef
  auxil/broker: Bump to latest master version
  cluster/zeromq: Catch log_push.send() exception
  cluster/zeromq: Catch exceptions as const zmq::error_t&
  cluster/zeromq: No assert on inproc handling
  cluster/zeromq: Support configuring IO threads for proxy thread
  cluster/zeromq: Move variable lookups from DoInit() to DoInitPostScript()
  cluster/zeromq: Handle EINTR at shutdown
  cluster/zeromq: Queue one message at a time
  cluster/Backend: Queue a single message only
  cluster/zeromq: Adapt for OnLoopProcess changes
  cluster/ThreadedBackend: Switch to OnLoopProcess
  cluster/OnLoop: Introduce helper template class
  serializer/broker: Expose to_broker_event() and to_zeek_event()
2025-03-11 10:51:09 +01:00
Arne Welzel
81acc4509d ci/opensuse-tumpleweed: Bust cache
Got a build failure because the old container images had python3-devel
for Python3.11 or something older, but then prepare.sh would install
Python 3.13 and Zeek's configure failing due to trying to find the
devel headers from python313-devel which wasn't installed by prepare.sh
2025-03-11 10:18:20 +01:00
Arne Welzel
70f5430e7c ci/macos/prepare: Install python@3 explicitly
It seems Homebrew's Python 3.12 doesn't install default symlinks or
python3 symlinks[1]. I believe this results in prepare.sh using the
system's Python rather than Homebrew's. Install python@3 explicitly
to put the symlinks in place.

[1] https://stackoverflow.com/a/77655631
2025-03-11 09:51:01 +01:00
zeek-bot
a62b7ffe4d Update doc submodule [nomail] [skip ci] 2025-03-11 00:14:11 +00:00
Arne Welzel
db28ff04e2 Merge remote-tracking branch 'origin/topic/awelzel/javascript-separate-thread'
* origin/topic/awelzel/javascript-separate-thread:
  btest/javascript: Add file_sniff() and file_state_remove() test
  Bump zeekjs to v0.15.0
2025-03-10 19:42:36 +01:00
Arne Welzel
e2b65acc6d btest/javascript: Add file_sniff() and file_state_remove() test
Using file_state_remove() or file_sniff() would previously crash with the
spicy-zip file analyzer. We don't have spicy-zip here, so it's not a
proper reproducer, but still makes sense to test these events.
2025-03-10 19:15:06 +01:00
Arne Welzel
cf154e02dd Bump zeekjs to v0.15.0
f5ff7c4 version: 0.15.0
    2a48143 docker/fedora: Bust cache and ensure sqlite-libs is updated
    05e5f57 Executor: Unblock SIGTERM in thread
    46496b9 Instance: Remove unsued variable
    c3b3c86 Instance: Offload JavaScript invocations to executor thread
    09e311f Introduce Executor helper

Mainly, run JavaScript on a separate thread for interoperability with
Spicy fiber stacks.

Closes #4239
2025-03-10 19:14:45 +01:00
Arne Welzel
6032741868 cluster/websocket: Implement WebSocket server 2025-03-10 17:07:30 +01:00
Arne Welzel
1e757b2b59 cluster/websocket: Add IXWebsocket submodule 2025-03-10 17:07:30 +01:00
Arne Welzel
0b49eac057 ci/alpine: Install openssl package for testing 2025-03-10 17:07:30 +01:00
Arne Welzel
9f768d1896 ci: Install websockets from pip for all distros
The cluster/websocket tests were developed against websockets 14.2,
but Ubuntu and Alpine ship too old versions. Switch to installing
the latest version from pip instead, so we don't need to bother making
tests compatible with very old Python packages shipped by distributions.
2025-03-10 17:07:30 +01:00
Arne Welzel
91eb2786be auxil/libunistd: Bump for ssize_t typedef 2025-03-10 17:07:30 +01:00
Arne Welzel
3a0216728c auxil/broker: Bump to latest master version 2025-03-10 17:07:30 +01:00
Arne Welzel
eb1f9f9a42 cluster/zeromq: Catch log_push.send() exception 2025-03-10 17:07:30 +01:00
Arne Welzel
b82dcfafa4 cluster/zeromq: Catch exceptions as const zmq::error_t& 2025-03-10 17:07:30 +01:00
Arne Welzel
8a1abfa8ef cluster/zeromq: No assert on inproc handling
This might happen if we didn't succeed in completely sending a multipart
message and stop early.
2025-03-10 17:07:30 +01:00
Arne Welzel
aad512c616 cluster/zeromq: Support configuring IO threads for proxy thread 2025-03-10 17:07:30 +01:00
Arne Welzel
ba7b605a97 cluster/zeromq: Move variable lookups from DoInit() to DoInitPostScript() 2025-03-10 17:07:30 +01:00
Arne Welzel
540d9da5ef cluster/zeromq: Handle EINTR at shutdown
Read ::signal_val and early exit a DoPublish() in case termination
happened while blocked in inproc.send()
2025-03-10 17:07:30 +01:00
Arne Welzel
94ec3af2b0 cluster/zeromq: Queue one message at a time
Queueing multiple messages can easily overload the IO loop without
creating any backpressure.
2025-03-10 17:07:30 +01:00
Arne Welzel
09ccb2e250 cluster/Backend: Queue a single message only
The ZeroMQ backend would accumulate multiple messages and enqueue them
all at once. However, as this could potentially result in huge batches
of events being queued into the event loop at once, switch to a one
message at a time model. If there's too many messages queued already,
OnLoop::QueueForProcessing() will block the ZeroMQ thread until
there's room available again.
2025-03-10 17:07:30 +01:00
Arne Welzel
827eccb732 cluster/zeromq: Adapt for OnLoopProcess changes 2025-03-10 17:07:30 +01:00
Arne Welzel
23405194a0 cluster/ThreadedBackend: Switch to OnLoopProcess 2025-03-10 17:07:30 +01:00
Arne Welzel
5dee77e6f2 cluster/OnLoop: Introduce helper template class 2025-03-10 17:07:30 +01:00
Arne Welzel
273a6ec1f3 serializer/broker: Expose to_broker_event() and to_zeek_event()
This is useful for reuse by WebSocket clients that use
the JSON v1 encoding.
2025-03-10 17:06:16 +01:00
Tim Wojtulewicz
e8d91c8227 Merge remote-tracking branch 'origin/topic/timw/ci-macos-upgrade-pip'
* origin/topic/timw/ci-macos-upgrade-pip:
  CI: Unconditionally upgrade pip on macOS
2025-03-10 08:29:04 -07:00
Tim Wojtulewicz
1b260333fd CI: Unconditionally upgrade pip on macOS 2025-03-10 08:09:41 -07:00
Tim Wojtulewicz
8ed503314d Merge remote-tracking branch 'origin/topic/timw/fix-double-to-docs'
* origin/topic/timw/fix-double-to-docs:
  Fix return types in docs for double_to_count and double_to_int
2025-03-10 06:11:56 -07:00
Tim Wojtulewicz
036eb94dff Fix return types in docs for double_to_count and double_to_int 2025-03-10 06:10:21 -07:00
Tim Wojtulewicz
574514b04c Update bifcl submodule [nomail] 2025-03-07 12:14:20 -07:00
Evan Typanski
c8f8bbaccb Merge remote-tracking branch 'origin/topic/etyp/print-type-const'
* origin/topic/etyp/print-type-const:
  Fix printing type constants like `double`
2025-03-07 13:14:22 -05:00
Tim Wojtulewicz
62a3119678 Merge remote-tracking branch 'origin/topic/timw/iwyu-clang-tidy'
* origin/topic/timw/iwyu-clang-tidy:
  Fix indentation in .clang-tidy
  Remove existing hand-written clang-tidy setup
  Add ability to enable iwyu and clang-tidy at configure time
2025-03-07 11:02:39 -07:00
Tim Wojtulewicz
bb6b44901b Fix indentation in .clang-tidy 2025-03-07 11:00:44 -07:00
Tim Wojtulewicz
36c1a3ca4a Remove existing hand-written clang-tidy setup 2025-03-07 11:00:44 -07:00
Tim Wojtulewicz
c1dd1e991e Add ability to enable iwyu and clang-tidy at configure time 2025-03-07 11:00:44 -07:00
Evan Typanski
4237239325 Fix printing type constants like double
Fixes #4268
2025-03-07 11:54:04 -05:00
zeek-bot
1d1ca92662 Update doc submodule [nomail] [skip ci] 2025-03-07 00:21:23 +00:00
Tim Wojtulewicz
81f7e77801 Merge remote-tracking branch 'origin/topic/timw/4266-tunnel-ip-proto'
* origin/topic/timw/4266-tunnel-ip-proto:
  Set ip_proto when creating new tunnel encapsulations
2025-03-06 16:42:03 -07:00