mORMot2 DailyDaily read of upstream commits

Async HTTP and Windows IOCP fix connection and response handling

Windows IOCP changes how subscriptions survive outstanding work. Async HTTP replies and streaming downloads get fixes for timing and partial writes. The edition also corrects Pascal UTF-8 validation and protects active SQL transactions from idle expiry.

TL;DR

  • Direct TWinIocp.GetNext users must release each returned reference with FinishNext.
  • THttpClientSocket does not retry after advancing the output stream.
  • Async responses retry lock acquisition and defer failed-write closure to their outer handler.
  • Idle SQL expiry skips connections reporting an active transaction.

Upgrade advice

For this historical snapshot, evaluate the complete 2.4.18170 batch rather than any intermediate IOCP rewrite. Update custom IOCP loops and TAsyncClient constructors, then verify response streaming and service shutdown. The payload has no superseded_by records; the build is an edition reference, not a claim that it is the latest safe revision.

Build2.4.18132 → 2.4.18170
Commits37
Lines+1857 -648
Read5 min

31 of 31 entries · 37 commits upstream

Stories
# Entry Category Units
1 High IOCP completions now carry a reference the caller must release Each non-nil TWinIocp.GetNext result owns a subscription reference until FinishNext. Posted, forwarded and dispatched work hold references; retired subscriptions are not dispatched again. Breaking changes mormot.net.sock+1 05f7339b+265-188

net: completed #805 IOCP fixes

Impact

Framework handlers release these references in finally. Custom Windows Delphi/FPC IOCP loops must do the same or retain subscriptions.

Migration required

Wrap processing of each non-nil TWinIocp.GetNext result in try/finally and call FinishNext exactly once in finally.

Public API

  • TWinIocp.FinishNextadded
  • TWinIocp.GetNextbehaviour-changed

Arnaud Bouchez · 10:38 UTC · PR #805 · view the commit on GitHub →

2 High The IOCP shutdown rewrite coordinates listener and completion owners TAsyncConnections frees the accept queue before the receive/send owner, stops rearming AcceptEx during shutdown, and introduces explicit completion draining in TWinIocp.Destroy. Fixes mormot.net.async+1 5f4992a1+169-68

net: reworked IOCP shutdown

Impact

This is an intermediate Windows shutdown implementation. The same-day follow-up replaces the destructor drain, so do not adopt the rewrite alone.

Worth a look

Arnaud Bouchez · 13:16 UTC · view the commit on GitHub →

3 High IOCP shutdown stops accepting before releasing its queues The follow-up marks TAsyncServer terminating before closing its listener and revises TWinIocp.Destroy to bound the waiter loop instead of draining posted completions there. Fixes mormot.net.async+1 0cf6088e+89-129

net: fixed IOCP regressions and some comments/documentation

Impact

Windows Delphi/FPC services using IOCP should verify shutdown with live sockets against the final sequence, not assume the earlier drain strategy is retained.

Worth a look

Arnaud Bouchez · 14:33 UTC · view the commit on GitHub →

4 High Overlapped receives no longer race to close a Windows socket twice TWinIocp tracks pending operations and defers subscription release until the final completion, recording whether Unsubscribe already closed the socket. Fixes mormot.net.sock 62968036+156-17

net: TWinIocp did call closesocket() twice on Unsubscribe with a pending wieRecv

Impact

Windows IOCP avoids the reported closure of an unrelated connection through a reused socket handle. Take the subsequent reference-lifetime fixes too.

Worth a look

Stefan Diestelmann · 08:41 UTC · view the commit on GitHub →

5 High The outer HTTP handler owns closure after failed writes Nested HTTP writes use WriteNoClose and propagate soClose to OnRead or AsyncResponse rather than closing the connection from inside DoResponse. Fixes mormot.net.async e97d7544+42-11

net: clean Write() closure of THttpAsyncServer.AsyncResponse

Impact

The async server keeps one owner for connection closure on failed response writes; ordinary Write retains its close-on-failure path.

Worth a look

Arnaud Bouchez · 20:20 UTC · view the commit on GitHub →

6 High Delphi POSIX process pipes ignore SIGPIPE SigPipeIntercept calls the new fpsigignore helper once successfully on Delphi POSIX, setting SIGPIPE to SIG_IGN for the process. Fixes mormot.core.os+1 077621bb+35-3

core: SigPipeIntercept ignores SIGPIPE on Delphi POSIX

Impact

A TExternalProcess.Write to a closed child stdin can return false instead of terminating the Delphi host through SIGPIPE. The FPC branch is unchanged.

Worth a look

Public API

  • fpsigignoreadded
  • TExternalProcess.Writebehaviour-changed

zen010101 · 16:19 UTC · view the commit on GitHub →

7 High Early async replies wait for a busy request lock THttpAsyncServer.AsyncResponse retries 40 ms lock attempts while the connection still exists, with a roughly five-second retry window and an explicit timeout exception. Fixes mormot.net.async bc1c1f06+22-7

net: fixed THttpAsyncServer.AsyncResponse lock contention

Impact

Delphi/FPC workers can answer before the request callback releases its lock without silently dropping the reply after one attempt.

Worth a look

Public API

  • THttpAsyncServer.AsyncResponsebehaviour-changed

Arnaud Bouchez · 20:34 UTC · view the commit on GitHub →

8 High Partial HTTP downloads are no longer retried into the same stream THttpClientSocket.RequestInternal closes the socket and returns the fatal status if the output stream position has advanced since the request began. Fixes mormot.net.client b6b3ce97+9-2

net: fixed THttpClientSocket unexpected retry

Impact

Delphi/FPC downloaders receive a failure instead of an automatic retry that could append invalid output. Existing partial bytes are not rolled back.

Worth a look

Public API

  • THttpClientSocket.Requestbehaviour-changed

Arnaud Bouchez · 20:42 UTC · view the commit on GitHub →

9 Medium Async TCP client construction drops the connect timeout argument TAsyncClient.Create removes aClientsTimeoutSecs and ThreadClientsConnect calls NewTcpClientSocket with zero timeout before enabling async mode. Breaking changes mormot.net.async 2977f73b+13-15

net: fixed TAsyncClient uneeded connection TimeOut parameter

Impact

Direct callers and constructor overrides in Delphi/FPC must match the shorter signature; startup sockets use the system connect behavior.

Migration required

Remove aClientsTimeoutSecs from TAsyncClient.Create calls and inherited constructor forwarding.

Public API

  • TAsyncClient.Createsignature-changed

Arnaud Bouchez · 15:51 UTC · view the commit on GitHub →

10 Medium Failed async client writes ask the poller to close THttpAsyncClientConnection.AfterWrite returns soClose after hcsFailed. The same commit synchronizes shared test state and adjusts test cleanup. Fixes mormot.net.async 2a686f74+73-42

test: fixed logic and reallow fast --multithread run

Impact

The Delphi/FPC runtime change is small but meaningful: ProcessWrite is now told to close the failed connection.

Arnaud Bouchez · 18:50 UTC · view the commit on GitHub →

11 Medium Async clients send their request after connect completion StartRequest sets ifWriteWait on the non-IOCP path too; ProcessWrite calls AfterWrite on connect completion even when no bytes are queued yet. Fixes mormot.net.async 2e275a98+93-4

net: THttpAsyncClientConnections.StartRequest sends its request once connected

Impact

Delphi/FPC async HTTP clients can start writing without a prefilled send buffer; failed completion can reach request error handling.

Worth a look

zen010101 · 11:24 UTC · view the commit on GitHub →

12 Medium The Pascal UTF-8 path rejects invalid sequences consistently IsValidUtf8Pas checks limits before reading continuation bytes and applies RFC 3629 range checks for overlong sequences, surrogates and out-of-range values. Fixes mormot.core.unicode 6770fe36+30-12

core: fixed IsValidUtf8Pas() RFC 3629 compliance

Impact

Backends exercising the Pascal text validator can reject input previously accepted by that path. Binary-buffer validation is a separate contract.

Worth a look

Public API

  • IsValidUtf8Pasbehaviour-changed

Arnaud Bouchez · 08:53 UTC · view the commit on GitHub →

13 Medium Async readers deliver bytes received just before EOF TPollAsyncSockets.ProcessRead processes bytes accumulated before an orderly close, then closes the connection instead of discarding those bytes. Fixes mormot.net.async e07bbc6d+31-5

net: TPollAsyncSockets.ProcessRead processes the data received just before the peer closed

Impact

Delphi/FPC async protocol handlers can receive a final buffered response fragment from a peer that closes immediately after sending.

Worth a look

zen010101 · 04:52 UTC · view the commit on GitHub →

14 Medium SQL preparation preserves the original exception subclass NewStatementPrepared raises the recorded ESynException subclass instead of replacing it with ECoreDBException on this propagation path. Fixes mormot.db.sql d1e9ab32+23-3

db: fixed unexpected exception class change during propagation

Impact

Delphi/FPC exception handlers can distinguish adapter-specific statement errors after propagation.

Worth a look

Public API

  • TSqlDBConnection.NewStatementPreparedbehaviour-changed

Arnaud Bouchez · 08:21 UTC · view the commit on GitHub →

15 Medium Pooled connections with active transactions do not expire for idleness TSqlDBConnection.IsOutdated checks GetInTransaction before applying idle expiry. Explicitly invalidated connections still count as outdated. Fixes mormot.db.sql 698a5e94+6-5

db: fixed TSqlDBConnection.IsOutdated

Impact

Idle pool recycling no longer selects a connection whose Delphi/FPC adapter reports an active transaction.

Worth a look

Arnaud Bouchez · 09:29 UTC · view the commit on GitHub →

16 Medium The Linux fallback actually signals eventfd The fallback LinuxEventFDWrite writes the QWord counter through FpWrite for positive file descriptors instead of doing nothing. Fixes mormot.core.os d0e39745+4-2

core: minimal LinuxEventFDWrite() implementation on all compilers

Impact

Linux builds on the fallback path can signal polling waiters; this commit also appears in the previous edition’s raw payload.

Arnaud Bouchez · 20:15 UTC · view the commit on GitHub →

17 Medium External ORM BLOB updates release statement rows TRestStorageExternal.EngineUpdateBlob calls ReleaseRows after ExecutePrepared and before processing change notifications. Fixes mormot.orm.sql 865966d1+3-2

orm: fixed TRestStorageExternal.EngineUpdateBlob

Impact

External SQL backends release the statement result on this successful update path before notifying ORM listeners.

Worth a look

Arnaud Bouchez · 08:16 UTC · view the commit on GitHub →

18 Medium Local FastCGI connects use the operating system timeout TFastCgiAsyncConnections.Send passes zero connection and I/O timeout values to NewSocket before switching the socket to async mode. Performance mormot.net.proxy df127cf7+11-8

net: much faster TFastCgiAsyncConnections local connections

Impact

Local FastCGI dials avoid the explicit timeout transition; the FastCGI response idle timeout is still stored separately.

Worth a look

Arnaud Bouchez · 15:53 UTC · view the commit on GitHub →

19 Medium The file-write constructor uses a signed share-mode parameter TFileStreamEx.CreateWrite changes aShareMode from cardinal to integer, distinguishing it from Create and keeping fmShareRead as default. Compiler & platform mormot.core.os a16690fc+4-2

core: TFileStreamEx.CreateWrite aShareMode is an integer, not a cardinal

Impact

Delphi packages and C++Builder bindings avoid the remaining duplicate signature; ordinary fmShare constants keep their meaning.

Worth a look

Public API

  • TFileStreamEx.CreateWritesignature-changed

vennexTSE · 16:58 UTC · view the commit on GitHub →

20 Low Server preview labels omit an unconfirmed feature release AppendOsBuild skips the feature-release suffix lookup for wServer2028_64, leaving the server version classification intact. Fixes mormot.core.os 4ffac49a+4-5

core: small fix after https://github.com/synopse/mORMot2/commit/2e7477980

Impact

The displayed OS description changes; no backend execution policy is altered.

Arnaud Bouchez · 11:09 UTC · view the commit on GitHub →

21 Low Windows module handles are cached for later lookup mormot.core.os publishes kernelHandle and ntHandle, and Windows helpers reuse them when resolving optional system functions. New features mormot.core.os+1 149c0304+19-18

core: new kernelHandle and ntHandle globals for Windows

Impact

Windows Delphi/FPC code can reuse the cached handles. No platform feature is enabled by this change alone.

Public API

  • kernelHandleadded
  • ntHandleadded

Arnaud Bouchez · 13:17 UTC · view the commit on GitHub →

22 Low Temporary buffers can append decoded hex bytes TSynTempAdder.AddHex decodes directly into the prepared buffer; empty or odd-length strings are ignored. New features mormot.core.base d07f24e3+27-7

core: new TSynTempAdder.AddHex method

Impact

Delphi/FPC code can append bytes from hex without building a separate decoded string.

Public API

  • TSynTempAdder.AddHexadded

Arnaud Bouchez · 16:18 UTC · view the commit on GitHub →

23 Low Windows version reporting recognizes newer build families The Windows matcher adds wServer2028_64 and the desktop build table maps 28000 to 26H1. New features mormot.core.os 2e747798+18-12

core: detect Windows Server 2028 preview and Windows 11 26H1 builds

Impact

Delphi/FPC diagnostics may report a more specific version; exhaustive application mappings should allow the new enum value.

Public API

  • wServer2028_64added

Arnaud Bouchez · 11:02 UTC · view the commit on GitHub →

24 Low Async response regressions gain dedicated tests DoHttpAsyncResponses registers coverage for early asynchronous replies and failed sends. Tests d31fc4db+242-2

test: cover #743 and #750 issues

Impact

The test suite changes; there is no production API or runtime change.

Arnaud Bouchez · 20:55 UTC · PR #743 · view the commit on GitHub →

25 Low UTF-8 tests separate text and buffer rules The Unicode tests compare documented expectations for valid and invalid UTF-8 input, including embedded zero bytes. Tests 65d30d1e+82-2

tests: cover UTF-8 validation expectations

Impact

The new assertions add coverage without changing application behavior.

Arnaud Bouchez · 08:57 UTC · view the commit on GitHub →

26 Low The FastCGI test server closes accepted sockets without blocking linger The fixture disables SO_LINGER and adds tracing; TCrtSocket.AcceptIncoming also emits a trace when OnLog is assigned. Tests mormot.net.sock 7b39e9a5+23-12

test: fixed FastCGI fake server slow socket process

Impact

Production socket behavior is unchanged apart from the additional optional log trace.

Arnaud Bouchez · 17:18 UTC · view the commit on GitHub →

27 Low The IOCP unsubscribe test runs as a slow-suite task WinIocpUnsubscribe is scheduled separately and opens local test connections without a connect timeout. Tests 9283fc17+11-10

test: optimized TNetworkProtocols coverage

Impact

Test scheduling and timing change, not production network behavior.

Arnaud Bouchez · 15:59 UTC · view the commit on GitHub →

28 Low Direct test tasks report their elapsed time TSynTestCase.Run times synchronous tasks that report progress and adds a local log scope. Tests mormot.core.test 91b1756e+14-3

core: refined TSynTestCase.Run() console and log output

Impact

Only console and logging output for tests is affected.

Arnaud Bouchez · 15:48 UTC · view the commit on GitHub →

29 Low Parallel test mode accepts a short command-line flag TSynTests declares multithrea&d so -d is a shortcut for --multithread. Tests mormot.core.test ee731ce1+4-4

core: define -d as shortcut for --multithread command line switch

Impact

Only test launcher commands change; deployed services do not use this option.

Arnaud Bouchez · 17:16 UTC · view the commit on GitHub →

30 Low UTF-8 validation simplifies several early exits IsValidUtf8Pas replaces several jumps to its final result with loop breaks in the lead-byte checks. Housekeeping mormot.core.unicode 559f2dae+8-8

core: another minor IsValidUtf8Pas() code cleaning

Impact

No intended application behavior or API change beyond the earlier UTF-8 correctness fix.

Arnaud Bouchez · 11:04 UTC · view the commit on GitHub →

31 Low The Pascal UTF-8 validator combines two rejection checks IsValidUtf8Pas combines the invalid lead class and truncated sequence length checks into one branch. Housekeeping mormot.core.unicode 06c573a9+5-9

core: minor IsValidUtf8Pas() simplification

Impact

The accepted input set is intended to stay the same as in the preceding fix.

Arnaud Bouchez · 09:30 UTC · view the commit on GitHub →

Upstream activity commits per day · last 60 days
Commits1007
Active days49/60
Busiest2026-09-30
Peak60
2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 12 commits2026-10-11: 2 commits2026-10-12: 40 commits2026-10-13: 31 commits2026-10-14: 23 commits2026-10-15: 16 commits2026-10-16: 27 commits2026-10-17: 0 commits2026-10-18: 0 commits2026-10-19: 0 commits2026-10-20: 0 commits2026-10-21: 0 commits2026-10-22: 3 commits2026-10-23: 6 commits2026-10-24: 29 commits2026-10-25: 7 commits2026-10-26: 25 commits2026-10-27: 4 commits2026-10-28: 8 commits2026-10-29: 17 commits2026-10-30: 20 commits2026-10-31: 0 commits2026-11-01: 0 commits2026-11-02: 16 commits2026-11-03: 32 commits2026-11-04: 15 commits2026-11-05: 32 commits2026-11-06: 26 commits2026-11-07: 19 commits2026-11-08: 2 commits2026-11-09: 29 commits2026-11-10: 17 commits2026-11-11: 8 commits2026-11-12: 38 commits2026-11-13: 39 commits2026-11-14: 9 commits2026-11-15: 6 commits2026-11-16: 21 commits2026-11-17: 30 commits2026-11-18: 37 commits2026-11-19: 28 commits2026-11-20: 31 commits2026-11-21: 0 commits2026-11-22: 0 commits2026-11-23: 1 commit2026-11-24: 6 commits2026-11-25: 3 commits2026-11-26: 3 commits2026-11-27: 0 commits2026-11-28: 0 commits
2026-09-302026-11-28