Skip to content

refactor(two-node): translate the Go event collector to a Python service - #1471

Merged
mxsrc merged 2 commits into
mainfrom
translate-go
Nov 23, 2026
Merged

mxsrc merged 2 commits into
mainfrom
translate-go

Conversation

@mxsrc

@mxsrc mxsrc commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

The two node arbitration has been implemented in Go for performance reason. It does introduce another language to this repo though, without the CI to test and ensure code quality that we have in place for Python code. Also, the abstractions that are available to Python code are not available to the Go code and need to be replicated. I confirmed the performance that we require is achievable in Python. This PR rewrites the component in Python to ensure a consistent codebase.

The change passes the CI tests specific to the two-node setup, and was confirmed in an actual two-node deployment.

@github-actions github-actions Bot added the target/main Targets the development branch label Oct 13, 2026
@mxsrc mxsrc added this to the 26.4 Beta 7 milestone Nov 17, 2026
@mxsrc
mxsrc force-pushed the translate-go branch 3 times, most recently from f635003 to 09d54e4 Compare November 20, 2026 16:21
mxsrc and others added 2 commits November 23, 2026 15:46
The Go toolchain pinned in docker/Dockerfile had drifted ~15 months behind
on stdlib patches, failing the daily security scan. Replace tools/event-
collector with simplyblock_core/services/two_node_event_collector.py,
reusing the jc_wait_events RPC client and arbitration.events.queue_event
path the Python arbiter already consumes.
…dying

_collect only caught RPCException, so a failed arbitration_events.queue_event
(FDB write) escaped uncaught and killed the worker thread -- it only came
back on the next _reconcile tick, via a full resync, instead of retrying
the same (instance, after_seq) in place the way the Go collector it
replaces did on any error. Catch it the same way.

Also ports the Go worker/supervisor coverage nothing carried over for the
rewrite: a failed store write doesn't advance after_seq and is safe to
redeliver, the collector thread survives one and keeps going, an unchanged
topology leaves a running worker alone, a node's address change takes
effect without restarting its worker, the ArbitrationEvent key layout
(docs/models/arbitration.py) now that only this model writes it, and the
idle/active rescan cadence end-to-end through main().

@Hamdy-khader Hamdy-khader left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mxsrc
mxsrc merged commit 70b61ab into main Nov 23, 2026
21 of 22 checks passed
@mxsrc
mxsrc deleted the translate-go branch November 23, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/main Targets the development branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants