Commit graph

595 commits

Author SHA1 Message Date
ppom
c352464b52
Adapt reaction core to plugin interface change 2026-02-09 12:00:00 +01:00
ppom
90886c1d55
cluster: adapt to plugin interface change 2026-02-09 12:00:00 +01:00
ppom
16dc41f825
ipset: adapt to plugin interface change 2026-02-09 12:00:00 +01:00
ppom
3e194dadd2
virtual: adapt to plugin interface change 2026-02-09 12:00:00 +01:00
ppom
f786a1d281
Change plugin interface: oneshot load_config and start
Instead of multiple stream_impl / action_impl and one finish_setup.
This made plugin implementations awkward: they often got some conf and
couldn't determine if it was valid or not.
Now they get all the conf in one function and don't have to keep partial
state from one call to another.

This has the other important benefit that configuration loading is
separated from startup. This will make plugin lifecycle management less
clunky.
2026-02-09 12:00:00 +01:00
ppom
b906c237bd
Start plugins after start commands
Because stop commands run after plugins' shutdown, so it seems better
that commands embrace ({ plugins }).

Fix outdated comment about aborting on startup.
2026-02-09 12:00:00 +01:00
ppom
425bc011aa
plugin: simpler crate version retrieval 2026-02-09 12:00:00 +01:00
ppom
362c875f1b
Fix time-based test sometimes failing by increasing sleep 2026-02-09 12:00:00 +01:00
ppom
d126a95786
cluster: ignore integration tests for now 2026-02-09 12:00:00 +01:00
ppom
75e543f76d
fix assert_cmd::cargo_bin deprecation warning 2026-02-09 12:00:00 +01:00
ppom
ac114c7373
fix: merge plugins in configuration 2026-02-09 12:00:00 +01:00
ppom
fc46831a87
ipset: add tests for configuration 2026-02-06 12:00:00 +01:00
ppom
2626b97092
ipset: re-arrange spacing in logs 2026-02-06 12:00:00 +01:00
ppom
715d149cd6
fix double-printing of square brackets in plugin logs 2026-02-06 12:00:00 +01:00
ppom
3e44568fa4
ipset: Manuel e2e test does pass 2026-02-06 12:00:00 +01:00
ppom
674a3ab531
ipset: do not shutdown plugin when one action errors 2026-02-05 12:00:00 +01:00
ppom
1489b08fd0
ipset: Fix dumb bug due to future not awaited
The edge case is so dumb, cargo is supposed to tell me about this ><

Just learnt that Python never warns about this btw:
https://trio.readthedocs.io/en/v0.9.0/tutorial.html#warning-don-t-forget-that-await
2026-02-04 12:00:00 +01:00
ppom
5817d52678
Better plugin process management
following stderr: task doesn't use shutdown anymore. It will simply follow
stderr until the end of reaction, which at worst is a negligible
memory leak if reaction continues running.
I tried closing stderr on the plugin side with a raw syscall of the file
descriptor, but reaction side doesn't see that stderr is closed.
So I can't rely on that.
Quitting when shutdown.wait() returns is too early, because that's also
what makes reaction asking for the plugin to close(), and it can print
important logs during its shutdown.
The task ignoring all the shutdown part is dead simple and is most likely
correct everytime.

updated the wording of plugin-related errors.

also replaced futures::select! { future, sleep() } with more concise and
macro-less tokio::timeout.
2026-02-03 12:00:00 +01:00
ppom
b2c0c19997
Print on stderr instead of stdout
...stdout is already taken by remoc ;)
2026-01-31 12:00:00 +01:00
ppom
48a67e6525
Extract ipset options from action options so that it's globally merged
Actions don't manage sets anymore.
Set options are merged at each new action,
then Sets are managed by themselves.
2026-01-31 12:00:00 +01:00
ppom
2f7c32aa8c
ipset: Add the add/del option, journal orders & deduplicate them 2026-01-29 12:00:00 +01:00
ppom
e618c5bcd1
ipset: so much ~~waow~~ code 2026-01-28 12:00:00 +01:00
ppom
cfd16b2bc6
reaction-plugin-ipset: first work session 2026-01-28 12:00:00 +01:00
ppom
05c6c1fbce
Fix tests
I initially wrote those tests with a test secret key file in the same directory.
Better having them write their own secret key file in their own dir
than a dangling test file in source code and be sensitive to the directory tests are run in.
2026-01-19 12:00:00 +01:00
ppom
615d721c9a
cluster: Upgrade iroh to 0.95.1 2026-01-19 12:00:00 +01:00
ppom
19ee5688a7
Testing with clusters of up to 15 nodes. Fails at ~6 to 9 nodes.
Still a "connection lost" issue.
Happens irregularly.
Nodes tend to ignore incoming connections because their id is too small.
I should debug why it is the case.
Nodes may succeed to recreate connections,
but they should not lose connections on localhost like that...
2026-01-19 12:00:00 +01:00
ppom
fb6f54d84f
Disable test where one plugin is in multiple nodes of one cluster. Test pass! 2026-01-19 12:00:00 +01:00
ppom
4fce6ecaf5
no long living task to try connect to a node. one shot task. add interval randomness. 2026-01-19 12:00:00 +01:00
ppom
5bfcf318c7
Tests on a cluster of 2 nodes 2026-01-19 12:00:00 +01:00
ppom
7ede2fa79c
cluster: Fix use of stream timestamp in action 2026-01-19 12:00:00 +01:00
ppom
1e082086e5
cluster: add tests
- on configuration
- on sending messages to its own cluster
2026-01-19 12:00:00 +01:00
ppom
5a44ae89e9
sleep a bit more to fix time-sensitive test 2025-12-16 12:00:00 +01:00
ppom
8b3bde456e
cluster: UTC: no need for conversions, as Time already is UTC-aware 2025-12-14 12:00:00 +01:00
ppom
2095009fa9
cluster: use treedb for message queue persistance 2025-12-15 12:00:00 +01:00
ppom
f414245168
Separate treedb into its own crate 2025-12-14 12:00:00 +01:00
ppom
c595552504
plugin: Remove action oneshot response 2025-12-07 12:00:00 +01:00
ppom
96a551f7b9
Remove debug 2025-12-07 12:00:00 +01:00
ppom
f6e03496e1
Fix plugin_cluster test, now passing 🎉 2025-12-07 12:00:00 +01:00
ppom
fbf8c24e31
cluster: try_connect opens the channels and handshakes itself
This fixes a deadlock where each node is initiating a connection
and therefore unable to accept an incoming connection.

connection_rx can now be either a raw connection or an initialized connection.
cluster startup has been refactored to take this into account and make
ConnectionManager create this channel itself.
2025-12-08 12:00:00 +01:00
ppom
114dcd9945
Remove extra space in plugin relogging 2025-12-07 12:00:00 +01:00
ppom
da257966d9
Fix connection time out 🎉
I misinterpreted a millisecond arg as seconds, so the timeout was at 2ms
and the keep alive at 200ms, what could go wrong?

Also I gave this TransportConfig option to connect too. If not, the
default is used, not the Endpoint's own config.
https://github.com/n0-computer/iroh/issues/2872
2025-12-07 12:00:00 +01:00
ppom
b14f781528
cluster: use reaction_plugin's PatternLine 2025-12-08 12:00:00 +01:00
ppom
c9e3a07fde
ignore cluster test for now 2025-12-07 12:00:00 +01:00
ppom
aac9a71d4e
DB migration for previous commit change 2025-12-07 12:00:00 +01:00
ppom
79d85c1df1
Reduce usage of chrono
TODO: handle migrations
2025-12-07 12:00:00 +01:00
ppom
1c423c5258
Fix panic caused by previous commit
Connection still close as soon as they idle :/
2025-12-07 12:00:00 +01:00
ppom
b667b1a373
Get rid of remoc for peer communications
I couldn't understand why all communications timed out as soon as all
messages are sent with a remoc RecvError::ChMux "multiplexer terminated".

So I'm getting rid of remoc (for now at least) and sending/receiving
raw data over the stream.

For now it panics, after the handshake complete, which is already good
after only one test O:D
2025-12-07 12:00:00 +01:00
ppom
83ac520d27
Connections have ids, to fix simultaneous connections races 2025-12-07 12:00:00 +01:00
ppom
81fa49aa5c
Add tests to virtual and use reaction-plugin's PatternLine
Those tests permitted to find the bug that led me to create PatternLine
Also add a serde option to deny extra keys in virtual action's config
2025-12-07 12:00:00 +01:00
ppom
e22429f92e
Add time to Exec messages, so that plugin actions don't have to calc this 2025-12-07 12:00:00 +01:00