Skip to content

Change pg_session_connection_failed to include a failure reason#163

Merged
SeanTAllen merged 1 commit intomainfrom
upgrade-lori-0.11.0
Mar 15, 2026
Merged

Change pg_session_connection_failed to include a failure reason#163
SeanTAllen merged 1 commit intomainfrom
upgrade-lori-0.11.0

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

@SeanTAllen SeanTAllen commented Mar 15, 2026

Adapts postgres internals to three breaking lori releases between 0.8.1 and 0.11.0:

  • 0.9.0: _on_connection_failure() and _on_tls_failure() now take a reason parameter
  • 0.11.0: expect() takes (Expect | None) instead of USize

The lori failure reasons are now threaded through the state machine to the public API: pg_session_connection_failed on SessionStatusNotify takes a ConnectionFailureReason — a closed union of ConnectionFailedDNS, ConnectionFailedTCP, SSLServerRefused, TLSAuthFailed, and TLSHandshakeFailed.

Other mechanical changes: FFI declarations in _mort.pony updated to match lori's, a mock server test fixed (moved send() from constructor to _on_started()), and MakeExpect(1) matches made exhaustive with _Unreachable().

Closes #161

@SeanTAllen SeanTAllen added the changelog - changed Automatically add "Changed" CHANGELOG entry on merge label Mar 15, 2026
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Mar 15, 2026
@SeanTAllen SeanTAllen added changelog - changed Automatically add "Changed" CHANGELOG entry on merge and removed changelog - changed Automatically add "Changed" CHANGELOG entry on merge labels Mar 15, 2026
@SeanTAllen SeanTAllen changed the title Update ponylang/lori dependency to 0.11.0 Change pg_session_connection_failed to include a failure reason Mar 15, 2026
@ponylang-main
Copy link
Copy Markdown
Contributor

Hi @SeanTAllen,

The changelog - changed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 163.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

pg_session_connection_failed now takes a ConnectionFailureReason — a
closed union of ConnectionFailedDNS, ConnectionFailedTCP,
SSLServerRefused, TLSAuthFailed, and TLSHandshakeFailed. The reason
is mapped from lori's failure types at the Session actor boundary,
keeping lori types out of the public API.

Also upgrades the lori dependency from 0.8.1 to 0.11.0, which required
adapting internal code to lori's new expect() constrained type and
failure callback signatures.

Closes #161
@SeanTAllen SeanTAllen force-pushed the upgrade-lori-0.11.0 branch from c85baaf to 6317a36 Compare March 15, 2026 17:08
@SeanTAllen SeanTAllen merged commit e28d086 into main Mar 15, 2026
8 checks passed
@SeanTAllen SeanTAllen deleted the upgrade-lori-0.11.0 branch March 15, 2026 17:20
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Mar 15, 2026
github-actions bot pushed a commit that referenced this pull request Mar 15, 2026
github-actions bot pushed a commit that referenced this pull request Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - changed Automatically add "Changed" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

upgrade to lori 0.11.0

2 participants