Skip to content

Research serverless platform behaviour for connection handling #8

Open

Description

@okomarov

Before designing the other serverless changes further, establish the platform facts they depend on, from documentation and experiments rather than assumptions.

Questions

  • Does a frozen Vercel or Lambda instance's monotonic clock (performance.now()) advance while frozen? Hand-out expiry uses the wall clock because this is unknown.
  • Do overdue timers fire immediately on thaw, and in what order relative to the incoming request?
  • What happens to an invocation that reaches maxDuration under fluid compute: only that invocation, or the whole instance? Is there any signal before suspension?
  • What does request.signal do on a timeout compared with a client disconnect?
  • @vercel/functions attachDatabasePool: its current API, which drivers it supports, and whether this client works with it or needs an adapter or an idle hook (Observing pool clients going into idle state porsager/postgres#1100).
  • Does Node expose TCP_USER_TIMEOUT or an equivalent for unacknowledged data? Keep-alive does not cover data in flight.
  • Which of these apply to Cloudflare workerd sockets, where a pool is not reused across requests (Fails with Error: The script will never generate a response. on cloudflare pages porsager/postgres#1013)?
  • How other clients handle the same problems: node-postgres (idleTimeoutMillis, query_timeout, statement_timeout), pgjdbc (socketTimeout, tcpKeepAlive), libpq (tcp_user_timeout, keep-alive parameters), the Neon serverless driver, Supabase guidance, and Prisma and Drizzle defaults on Vercel.

Method

A harness can freeze the client process with SIGSTOP for N seconds and resume it with SIGCONT, then check that the first request after thaw does not use a stale connection.

Same design limit as porsager#1013 (one pool shared across Cloudflare requests): porsager#884 and porsager#865.

Activity

  1. added
    enhancement
    on Oct 9, 2026
  2. moved this to Next in Roadmapon Oct 15, 2026
  3. added
    area: connections
    documentation
    upstream
    on Oct 16, 2026
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

    area: connectionsdocumentationenhancementupstream

    Type

    No type

    Projects

    • Status
      Next

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions