Skip to content

Diagnose the PostgreSQL and Redis realtime stream load failure #53

Done

Description

@chrisbbreuer

The HQ.support dependency candidate on main 1a8afdf with @stacksjs/support@0.75.708 passed 117 of 118 tests. The routed realtime fixture failed on PostgreSQL with Redis hints at line 461, while opening one of the 1,000 simultaneous customer streams. The assertion expects HTTP 200, text/event-stream, and the current customer origin. The assertion did not record which response property differed. The same run passed SQLite with local and Redis hints and PostgreSQL with local hints. The native SDK/auth bridge, saved replies, and 85 team browser checks passed separately on this exact candidate.

  • Reproduce through the real routed PostgreSQL/Redis fixture and capture the status, bounded error code, and header presence without logging credentials.
  • Compare the published dependency candidate with the current locked app if the failure reproduces.
  • Fix the demonstrated cause and preserve the 1,000-live-stream assertion, current-origin check, operator stream at capacity, native cleanup, and credential scoping.

The observed failure was confined to disposable local test services. Track dependency integration in #4.

Activity

  1. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    The full 1,000-stream PostgreSQL and Redis case passed in isolation on both locks from the same HQ.support source 1a8afdf: 137.2 s with the 0.75.708 candidate and 112.6 s with current 0.75.707. Each used a fresh loopback database and Redis server. The fixture retained the original assertions and recorded status, bounded error code, and CORS-header presence on a mismatch. Neither isolated run emitted a mismatch.

    The 14 realtime and 29 router JavaScript files in the published 0.75.707 archives also matched the installed 0.75.708 files byte for byte. The original full-suite failure remains unresolved. A later isolated pass leaves its response status and trigger unknown.

  2. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    Reproduced the failure in the four-case realtime matrix against the merged 0.75.708 dependency lock at 7f1dc64. SQLite passed with local and Redis hints, and PostgreSQL passed with local hints. With PostgreSQL and Redis, a batch of 16 customer stream opens returned HTTP 503, realtime_unavailable, JSON, and the expected customer CORS grant during the 1,000-stream run. The fixture recorded no retry header.

    A focused run retaining all 1,000-stream assertions passed on the same lock. A separate controlled Redis acknowledgement probe demonstrated that Stacks currently keeps an acknowledged topic's registration pending until a second, unrelated topic is acknowledged. Letting the second command reach its deadline rejected both registrations. Native traces are being collected to see whether this behavior caused the routed failure.

    A local test-only diagnostic now records the exact status, content-type match, CORS match, and a bounded error code. A loopback test using a deliberately invalid synthetic session confirmed it reports 401 and invalid_session without recording credentials or response bodies.

  3. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    The isolated native trace on the original runtime passed and did not emit an error, so it did not capture the cause of the routed 503s. The independently reproducible Redis acknowledgement defect is now tracked in Stacks #3467, with a fix and regression in Stacks PR #3468.

    The candidate passed all 104 Stacks realtime tests and the full 1,000-stream PostgreSQL and Redis test against HQ.support 056fb1c, using a disposable local install. A new run is exercising all four database and invalidation combinations with the exact PR source. Keep this issue open for the intermittent routed failure and qualification with the released package.

  4. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    The exact locked main at 056fb1c also passed the PostgreSQL and Redis 1,000-stream fixture in the full CI suite. The case completed in 141.6 seconds and the suite passed 118 of 118 tests. This adds a passing full-suite sample on released Stacks 0.75.708. The intermittent 503 reproduction and the released-package qualification remain open. Main CI

  5. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    HQ.support main 056fb1c passed all 118 GitHub CI tests on the released Stacks 0.75.708 lock, including the four SQLite/PostgreSQL and local/Redis replay cases.

    The local matrix with exact Stacks PR #3468 and the local matrix with the traced original runtime both passed the SQLite cases and the 1,000-stream PostgreSQL/Redis case. The original runtime emitted no Redis readiness failure in the traced run. Both timed out in PostgreSQL with local hints while the workstation's measured load was elevated. The unchanged PR candidate then passed that same PostgreSQL/local case in isolation in 97.4 seconds. The fixture's assertions and timeout were unchanged.

    These runs verify each candidate combination and the independent framework regression. The prior routed 503s still lack a confirmed root cause, and adoption remains open until a published candidate is qualified. Exact HQ.support main CI · Stacks readiness PR

  6. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    A test-only diagnostic on exact HQ.support source b1c9f33 now distinguishes the two public 503 responses that share realtime_unavailable. The routed fixture verified a PostgreSQL storage refusal classifies as request and native subscription-cap refusal as stream-open. For unexpected failures the diagnostic reports the status, exact CORS and content-type checks, retry-header presence, bounded error code and one of those fixed labels. It does not print credentials, identifiers, response headers or bodies.

    The focused PostgreSQL and Redis 8.2.2 run passed the unchanged 1,000-live-stream requirement and both new classification checks in 143.1 seconds. The frozen published 0.75.708 dependency lock and manifest hashes matched before and after. This run did not reproduce the intermittent 503, so its cause remains open. The refreshed Stacks regression also passed 104 local realtime tests. Stacks regression and exact CI

  7. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    Two additional exact checks passed. On released Stacks 0.75.708, HQ.support 040db4a passed all 120 main CI tests, including the routed PostgreSQL and Redis case with 1,000 concurrent Messenger subscriptions in 136.74 seconds. On HQ.support 5647c4a, the same routed case passed on disposable PostgreSQL and Redis using the official @stacksjs/realtime preview built from Stacks PR #3468 at 41abaf6. The preview case completed in 97.42 seconds and made no change to the app's committed dependency lock.

    Neither run reproduced the earlier intermittent routed HTTP 503. The stable framework release containing the PR and the confirmed cause of those earlier responses remain open.

    Exact HQ.support CI · Exact Stacks preview build

  8. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    The routed load fixture now emits a bounded wire diagnostic when opening a stream fails. It records the status, the expected content-type and CORS checks, retry-header presence, a validated error code, and either request or stream-open for the two public 503 paths. Failed setup stops new enrollment, waits for the in-flight workers, and closes all collected streams. The fixture still requires all 1,000 live Messenger streams and the concurrent operator stream.

    All four SQLite/PostgreSQL and local/Redis matrix cases passed on the current lock. The PostgreSQL and Redis case passed in 128.89 seconds, including the controlled request-path and stream-open refusals. The intermittent load failure did not recur. Stacks merged the separate Redis acknowledgement fix, and HQ.support still needs to verify an installed stable version containing it.

    Diagnostic on main · Exact main CI · Merged Stacks fix

  9. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    Buddy's native patch release pushed Stacks v0.75.711 at 8722c172. The tag contains the merged Redis acknowledgement fix and the release concurrency guard. The exact release workflow is waiting for its source CI. Published-package readback and the installed HQ.support load test follow that workflow.

    Release commit · Release workflow

  10. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    I reproduced one Redis readiness failure through the authorized widget HTTP stream on a disposable SQLite database. The fixture opens two customer topics, acknowledges the first, then holds the second Redis SUBSCRIBE acknowledgement past the app's deadline. A third request reuses the first topic.

    Dependency First customer Second customer First customer, repeated
    HQ locked @stacksjs/realtime@0.75.708 503 503 503
    Stacks build from merged commit 41abaf6 SSE 200 before the held command expires 503 SSE 200 before the held command expires

    The locked build returned the same bounded realtime_unavailable response from stream open on all three requests. The fixed build returned the connected SSE frame for both eligible requests and preserved exact customer-origin CORS on every response. This confirms that a delayed acknowledgment for an unrelated topic can cause an avoidable HTTP 503 on the old build. The earlier PostgreSQL load failure has no retained response trace, so its trigger remains unconfirmed. The public 0.75.711 artifact still needs the controlled check and the real PostgreSQL and Redis load matrix after release acceptance.

  11. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    Verified @stacksjs/realtime@0.75.711 and @stacksjs/support@0.75.711 on HQ.support revision 46e8bda against two npm installs. The first used the existing 0.75.708 app baseline with published Realtime and Support. The second used the full published 0.75.711 cohort and published Buddy 0.75.711. buddy support:install --sdk-only pinned the SDK, a frozen reinstall preserved the lockfile, and all four SDK exports loaded. The installed Support and Realtime dist trees matched the SHA-512-verified npm archives byte for byte. The app, elements, and stx view typechecks passed on the full cohort.

    The routed PostgreSQL 18.4 and Redis 8.2.2 test passed in 94.6 and 94.8 seconds respectively. Each run opened 1,000 simultaneous customer subscriptions, verified the operator stream at capacity, exercised the controlled request and stream-open refusals, and cleaned up its disposable services. The original intermittent failure did not recur. Keep the diagnostic in place for a recurrence with enough evidence to classify the response.

    Published Realtime · Installed app source

  12. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    Public npm @stacksjs/realtime@0.75.711 passed the exact-archive check. I verified the registry integrity and matched the installed realtime files byte for byte. On HQ main 46e8bda, that package passed all four native HTTP replay tests on SQLite and PostgreSQL with both local and Redis transport. The PostgreSQL/Redis case held 1,000 authorized subscriptions and passed in 94.47 seconds.

    The same published package passed the controlled delayed-acknowledgement case. Both requests for the acknowledged customer topic returned SSE 200 before the unrelated command expired. The request on the held topic returned the expected 503. The trigger of the original intermittent load failure remains unknown.

    Aligned Stacks update #58 now has all 37 framework packages and both frozen lockfiles. Its exact combined CI is queued. Promotion still requires that CI and a staging verification. The Stacks release passed the published framework install. The later sample authentication failure is tracked in Stacks #3440.

  13. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    The controlled case now also reproduces through the real hosted route code on disposable PostgreSQL and Redis. A loopback relay let Redis execute both SUBSCRIBE commands and delayed delivery of one acknowledgement. On the locked 0.75.708 build, all three authenticated HTTP requests returned the bounded stream-open 503. With the full 0.75.711 app dependency set, both requests for the acknowledged topic connected over SSE before the deadline and only the held topic returned 503. Exact CORS passed for every response.

    This supplies the PostgreSQL and Redis response signature for the demonstrated cause. The original intermittent load run did not retain a response trace. Aligned dependency PR

  14. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    5dd5e699 with the published Stacks 0.75.711 cohort is merged and active on shared HQ.support staging. Its exact pre-merge verification passed 120 tests across 37 files and 99 native team browser checks. I independently verified all six served widget files against the exact main CI artifact over staging HTTPS. Homepage, login, public Messenger config, and the signed-out guard passed. This is an adoption and deployment check. The prior controlled PostgreSQL/Redis reproduction still supplies the failure signature, and the original intermittent load run still has no retained response trace. Merged #58 · Exact browser and application CI · Staging deployment

  15. chrisbbreuer commented on Nov 27, 2026

    @chrisbbreuer
    MemberAuthor

    PR #58 was promoted to main at the exact tested commit 5dd5e69 and deployed through Buddy to Hetzner staging. Exact CI passed all 120 application tests and all 99 team and search browser checks. The native PostgreSQL and Redis workload retained 1,000 authorized live subscriptions and passed in 112.04 seconds. The hosted web and API releases both verified the installed Buddy and realtime versions as 0.75.711.

    The staged HTTPS journey verified the initial authenticated stream, finite replay, independent routing, cross-process worker publication, one scheduled reopen, draft retention, customer isolation, and two-way typing. The controlled PostgreSQL and Redis case isolated the delayed-acknowledgement failure on the old lock and passed with the published package. The original intermittent run omitted its response trace, so its exact trigger remains unknown.

    Exact CI · Merged #58 · Staging deployment · Controlled replay evidence

  16. chrisbbreuer commented on Nov 28, 2026

    @chrisbbreuer
    MemberAuthor

    The one open-stream failure recurred in the full HQ.support run against the Stacks commit packages at a84fb98 on Bun 1.4.5. The captured response was HTTP 503 JSON with code realtime_unavailable, exact CORS, and failure stage stream-open during the 1,000-subscriber PostgreSQL and Redis workload. The full run passed 124 of 125 tests. The exact failing case then passed in 153.44 seconds with fresh disposable PostgreSQL and Redis and the same app and dependencies.

    The Stacks realtime source has no changes between the app's current stable Stacks 0.75.712 and this preview. The response identifies the failure path. It does not establish the Redis acknowledgement or deadline that triggered it. Reopening to retain this evidence and verify the full workload with the installed 0.75.716 release. If it recurs, capture bounded native invalidation status and timing in the disposable run while preserving the existing 1,000-stream assertion.

    Exact app scope and qualification · Earlier controlled Redis fix

  17. chrisbbreuer commented on Nov 28, 2026

    @chrisbbreuer
    MemberAuthor

    The current HQ.support main baseline d53edd9 passed the exact 1,000-subscriber PostgreSQL and Redis route case with installed @stacksjs/realtime@0.75.712, Bun 1.4.5, and fresh disposable services. It took 106.26 seconds. The route and fixture source match the framework preview candidate. Both the baseline and the isolated preview rerun passed. The earlier full-preview stream-open 503 remains unexplained and the full installed-release run is still required.

    The installed-release candidate d240146 also passed the same 1,000-live-subscriber PostgreSQL and Redis route case in 101.77 seconds. It used the published @stacksjs/realtime@0.75.716, Bun 1.4.5, and fresh disposable PostgreSQL and Redis. The complete suite is running through the app pull request. Exact app PR · Full CI

    The exact app PR finished with 125 tests passing, including the PostgreSQL and Redis 1,000-live-subscriber case in 136.27 seconds. The tested tree is on main at d240146. The initial one-off preview failure remains documented above. Passing app CI

  18. chrisbbreuer commented on Nov 28, 2026

    @chrisbbreuer
    MemberAuthor

    The published Stacks 0.75.716 release passed the 1,000-live-subscriber PostgreSQL and Redis route check on the installed local candidate and in both exact full CI runs. Main d240146 completed the workload in 124.41 seconds and passed all 125 application tests. The routed test exercised the exact browser origin, the operator stream at capacity, cleanup, and credential scoping.

    The preview run's one stream-open 503 and the earlier controlled Redis acknowledgement finding remain recorded in this issue. That preview failure did not recur in the installed-release qualification.

    Exact main CI · Exact PR CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions