mORMot2 DailyDaily read of upstream commits

Async OpenSSL handshakes retry correctly while TSynLog shortens its write lock

OpenSSL-backed non-blocking clients and servers now retry SSL_connect and SSL_accept after WANT_READ or WANT_WRITE instead of treating them as fatal. The final commit preserves the first SSL_get_error result so real handshake failures report the correct cause. TSynLog also moves stack-trace and system-information collection outside its writer lock, reducing contention at the cost of larger per-thread state and bounded suffixes.

TL;DR

  • Land on build 2.4.17024 at 13c7b4dd94b23c25d51e5b0ab9b6e207cb039207.
  • OpenSSL TLS handshakes over asynchronous sockets now retry WANT_READ and WANT_WRITE for up to five seconds.
  • Avoid builds 2.4.17020–2.4.17023: the new retry loop re-queries SSL_get_error while reporting a terminal failure; build 2.4.17024 passes the captured code.
  • TSynLog pre-renders configured stack traces and system information before taking its per-writer lock.
  • The TSynLog thread record grows by 320 bytes, stack-trace suffixes are capped at 255 bytes and system-information suffixes at 63 bytes.
  • AppendSysInfo is a new public helper that appends system information without clearing an existing ShortString.

Upgrade advice

Land on build 2.4.17024. OpenSSL users with non-blocking sockets should upgrade and exercise both client SSL_connect and server SSL_accept under WANT_READ, WANT_WRITE, timeout and certificate failure. Do not stop on 2.4.17020–2.4.17023 because the retry path’s final error report is incomplete. If LevelStackTrace or LevelSysInfo is enabled, compare log suffixes and account for 320 additional thread-local bytes per logging thread.

Build2.4.17019 → 2.4.17024
Commits5
Lines+180 -116
Read2 min

5 of 5 entries · 5 commits upstream

Stories
# Entry Category Units
1 High Non-blocking OpenSSL handshakes wait instead of failing immediately TOpenSslNetTls.AfterConnection and AfterAccept now call CheckProc around SSL_connect and SSL_accept. CheckProc retries SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE, waits for the matching TNetEvents set and enforces a five-second deadline. TShort95 and PShort95 are also added. Fixes mormot.core.base+1 1e45eae5+43-6

lib: fixed unexpected TLS exception with OpenSSL async socket

Impact

OpenSSL-backed asynchronous clients and servers no longer turn a normal non-blocking handshake transition into an EOpenSsl exception. A stalled handshake now raises an explicit timeout after five seconds.

Public API

  • TShort95added — A public string[95] alias and its PShort95 pointer type are now available.

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

2 High TLS failures retain the error captured beside SSL_connect EOpenSsl.CheckFailed accepts an optional sslerrcode. TOpenSslNetTls.CheckProc passes the error returned by CheckSsl immediately after SSL_connect or SSL_accept, so the exception formatter does not call SSL_get_error again after intervening work. Fixes mormot.lib.openssl11 13c7b4dd+10-6

lib: fixed TOpenSslNetTls.CheckProc error report

Impact

Terminal certificate, protocol and peer failures on the new asynchronous handshake path report the original SSL_ERROR_* state and its verification context instead of a stale or unrelated code.

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

3 Medium Stack and system suffixes are rendered before the log lock TSynLog.LockAndPrepareWrite now fills thread-local StackTrace and SysInfo buffers before fWriteSafe.Lock. LogTrailerAndUnlock appends those buffers and releases the lock. TSynLogThreadInfo gains a 255-byte ShortString and a TShort63, increasing its documented per-thread size by 320 bytes. Performance mormot.core.log b1ddba46+80-60

core: TSynLog pre-renders the stack trace and the sysinfo

Impact

Slow stack-symbol loading and operating-system queries no longer extend the serialized log-writing section. Services with many logging threads consume more thread-local memory, and configured suffixes are now capped at 255 and 63 bytes respectively.

Worth a look

If LevelStackTrace or LevelSysInfo is enabled, compare suffix completeness and measure contention plus thread-local memory on a representative workload.

Public API

  • TSynLogFamily.LevelStackTracebehaviour-changed — Configured stack traces are pre-rendered outside the write lock and capped at 255 AnsiChars.
  • TSynLogFamily.LevelSysInfobehaviour-changed — Configured system-information suffixes are pre-rendered outside the write lock into TShort63.

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

4 Low System information can be appended to existing short text mormot.core.os exposes AppendSysInfo, which appends processor, load, uptime and memory data to a ShortString without clearing it. RetrieveSysInfoText now clears the destination and delegates to the new helper. A leftover CheckProc writeln is removed. New features mormot.core.os+1 ea2c5066+11-4

core: new AppendSysInfo() function

Impact

Existing RetrieveSysInfoText callers keep replacement semantics. New callers can construct compact prefixed diagnostics in one bounded ShortString, and OpenSSL handshake retries no longer write debug lines to standard output.

Public API

  • AppendSysInfoadded — The procedure appends system information to the supplied ShortString and does not reset its existing content.

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

5 Low Debug-file registration avoids unnecessary exclusive locking DebugFileRegister checks shutdown and known-unknown libraries under DebugFilesSafe.ReadLock before acquiring WriteLock, then rechecks inside the write section. RawStackTrace simplifies its exception guard, and AppendCallerShort stops resolving symbols outside the executable. Under the hood mormot.core.log d09fc6cd+36-40

core: some TSynLog and stack trace refactoring

Impact

Repeated stack resolution for libraries already known to lack debug data no longer serializes all readers behind a write lock. AppendCallerShort output is limited to executable debug information; FindLocationShort still resolves external library names and symbols.

Public API

  • TDebugFile.AppendCallerShortbehaviour-changed — Caller stacks no longer include fallback names or symbols for frames outside the executable.

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

Upstream activity commits per day · last 60 days
Commits977
Active days44/60
Busiest2026-09-30
Peak60
2026-08-15: 0 commits2026-08-16: 0 commits2026-08-17: 0 commits2026-08-18: 0 commits2026-08-19: 0 commits2026-08-20: 0 commits2026-08-21: 0 commits2026-08-22: 0 commits2026-08-23: 0 commits2026-08-24: 0 commits2026-08-25: 0 commits2026-08-26: 0 commits2026-08-27: 26 commits2026-08-28: 11 commits2026-08-29: 10 commits2026-08-30: 1 commit2026-08-31: 23 commits2026-09-01: 0 commits2026-09-02: 20 commits2026-09-03: 29 commits2026-09-04: 35 commits2026-09-05: 13 commits2026-09-06: 0 commits2026-09-07: 0 commits2026-09-08: 23 commits2026-09-09: 10 commits2026-09-10: 17 commits2026-09-11: 23 commits2026-09-12: 14 commits2026-09-13: 9 commits2026-09-14: 7 commits2026-09-15: 4 commits2026-09-16: 24 commits2026-09-17: 26 commits2026-09-18: 21 commits2026-09-19: 59 commits2026-09-20: 13 commits2026-09-21: 5 commits2026-09-22: 34 commits2026-09-23: 17 commits2026-09-24: 57 commits2026-09-25: 22 commits2026-09-26: 26 commits2026-09-27: 0 commits2026-09-28: 2 commits2026-09-29: 19 commits2026-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: 33 commits2026-10-11: 9 commits2026-10-12: 11 commits2026-10-13: 35 commits
2026-08-152026-10-13