Skip to content

experiment: drop deferredEmit, rely on cpp-sdk #68 - #29

Draft
igor-sirotin wants to merge 2 commits into
masterfrom
experiment/try-remove-deferred-emit
Draft

experiment: drop deferredEmit, rely on cpp-sdk #68#29
igor-sirotin wants to merge 2 commits into
masterfrom
experiment/try-remove-deferred-emit

Conversation

@igor-sirotin

Copy link
Copy Markdown
Collaborator

Why

chat-module #24 added deferredEmit (commit e3a9078) to fix e2e exit-4 timeouts on GHA ubuntu-latest. The diagnosis at the time attributed it to same-thread event-loop starvation: libchat result callbacks fire synchronously inside LOGOS_METHOD, keeping the Q_INVOKABLE slot on the stack so QLocalSocket can't flush the QtRO reply before the caller's 20s deadline.

cpp-sdk #68 (merged 2026-05-25) addresses a related-but-distinct symptom: events fired from a foreign thread raced QtRO source serialization against the method-reply flush, silently dropping replies. The final form uses Qt::AutoConnection, which keeps same-thread emits synchronous and only queues cross-thread emits.

If the original same-thread diagnosis was correct, this revert will re-introduce the 20s timeout. If the failures were actually cross-thread (libchat dispatches callbacks from a worker), AutoConnection in cpp-sdk #68 already covers it and deferredEmit is redundant.

What

  • revert: drop deferredEmit workaround for event-loop starvation — undoes the runtime portion of e3a9078: removes the QueuedConnection deferral, the m_emitRouter QObject anchor, and the QObject/QMetaObject includes. Result callbacks now call impl->emitEvent() directly.
  • chore: bump logos-cpp-sdk for provider-event threading fixnix flake update logos-module-builder advances cpp-sdk to d77c3dd (#68).

Validation

CI's integration-tests job on ubuntu-latest is the discriminator — that's the runner where the original exit-4s reproduced. Several consecutive green runs ⇒ the workaround was redundant. Any exit-4 timeouts ⇒ back this out.

Draft until CI confirms.

Reverts the runtime portion of e3a9078: removes the QueuedConnection
deferral in libchat callbacks, the m_emitRouter QObject anchor, and
the QObject/QMetaObject includes. Result callbacks now invoke
impl->emitEvent() directly.

Rationale: cpp-sdk d77c3dd (#68) routes provider events through the
source thread via AutoConnection. If libchat's result callbacks
were actually firing from a worker thread (rather than the
synchronous same-thread invocation the original comment assumed),
the AutoConnection fix subsumes the workaround. The e2e job on
ubuntu-latest is the validation — re-runs that stay green on this
branch indicate the workaround was redundant.

If e2e exit-4 timeouts reappear, the original same-thread diagnosis
holds and this revert should be backed out.
Pulls logos-module-builder forward so logos-cpp-sdk advances to
d77c3dd (#68), which marshals provider events onto the source
thread via AutoConnection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant