Conversation
Adds a use_relay_thread boolean config option (default: true) that controls whether relay state is isolated on a dedicated executor thread. Disabling it is intended for baseline performance comparison only. Also removes the hard error that rejected threads > 1, replacing it with a targeted check: threads > 1 requires use_relay_thread=true. This unlocks the config validation only — threads > 1 with use_relay_thread=true will race on shared relay state until the following commit wires up the dedicated relay executor.
akash-a-n
left a comment
There was a problem hiding this comment.
@akash-a-n reviewed 25 files and all commit messages, and made 2 comments.
Reviewable status: 25 of 26 files reviewed, 1 unresolved discussion (waiting on afrind, gmarzot, michalhosna, mondain, Oxyd, peterchave, suhasHere, and TimEvens).
src/MoqxRelay.cpp line 872 at r4 (raw file):
} } if (session.get() == upstreamSession.get()) {
is self fetch not a concern anymore? Claude just flagged this.
michalhosna
left a comment
There was a problem hiding this comment.
@michalhosna made 1 comment.
Reviewable status: 25 of 26 files reviewed, 2 unresolved discussions (waiting on afrind, gmarzot, mondain, Oxyd, peterchave, suhasHere, and TimEvens).
src/MoqxRelay.h line 129 at r4 (raw file):
// cross-executor filters. relayExec must outlive this relay. // If not set (default), all operations run on the calling thread. void setRelayExec(folly::Executor* relayExec) { relayExec_ = relayExec; }
It seem unsafe to call setRelayExec after the relay starts to do anything, so why is it not in constructor? Or some kind of safe-check that it's called only once.
Looking at #363 its used there in resetRelay in the test fixture, but I am not sure it's correct. When alling this on relay where ownedRelayExec_ != null, the ownedRelayExec_ stays dangling, that's probably fine?
Is this whole method with sharing executor tests only? Should we gate it more?
Reviewing this one without #363 seems to not make much sense. I'll redo my review there.
This change is