Skip to content

ntf server: concurrent notification delivery#1779

Merged
epoberezkin merged 9 commits into
masterfrom
sh/ntf-debug
May 18, 2026
Merged

ntf server: concurrent notification delivery#1779
epoberezkin merged 9 commits into
masterfrom
sh/ntf-debug

Conversation

@shumvgolove
Copy link
Copy Markdown
Collaborator

No description provided.

Change PPRetryLater from nullary to PPRetryLater Text so the cause
(503 / 410-reason) propagates to the retry call site. Log a warning
at every retry attempt with provider, token id and reason.
Fork delivery per notification, taking an MVar keyed by srvHost_ so
notifications from the same SMP server serialize while different
servers proceed concurrently. Switch APNS to sendRequestDirect so
concurrent deliveries share one HTTP/2 connection via stream
multiplexing rather than serializing through the client reqQ.
@shumvgolove shumvgolove force-pushed the sh/ntf-debug branch 2 times, most recently from 6789bc3 to 5e90939 Compare May 15, 2026 14:24
Match the take/create/wait pattern in Agent/Client.hs
(newProtocolClient / waitForProtocolClient). pushClients now wraps
clients in SessionVar (Either SomeException PushProviderClient) so
concurrent first-time access and concurrent retries collapse to a
single mkClient call; waiters observe the winner's result via
readTMVar (or its error). retryDeliver evicts the failing client by
SessionVar identity before re-fetching.
@evgeny-simplex evgeny-simplex force-pushed the sh/ntf-debug branch 2 times, most recently from c1c9796 to 915a0c7 Compare May 17, 2026 13:13
@epoberezkin epoberezkin changed the title ntf-server: debug delivery ntf server: concurrent notification delivery May 18, 2026
@epoberezkin epoberezkin merged commit 012c8cc into master May 18, 2026
3 of 6 checks passed
@epoberezkin epoberezkin deleted the sh/ntf-debug branch May 18, 2026 08:26
epoberezkin pushed a commit that referenced this pull request May 18, 2026
The per-(srvHost, provider) worker shards added in #1779 still funnel
all APNS sends through one HTTP2Client's reqQ, where a single process
thread calls sendRequest serially - one in-flight HTTP/2 stream at a
time, capping APNS throughput at 1/RTT.

sendRequestDirect bypasses the queue and invokes sendReq directly from
the calling worker, so concurrent workers open parallel HTTP/2 streams
on the shared APNS connection and the multiplexing happens on the wire.
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.

3 participants