Skip to content

Port to OTP 28/29 and hackney 4.2.2#209

Merged
benoitc merged 3 commits into
masterfrom
feature/otp29-hackney4
Jun 9, 2026
Merged

Port to OTP 28/29 and hackney 4.2.2#209
benoitc merged 3 commits into
masterfrom
feature/otp29-hackney4

Conversation

@benoitc

@benoitc benoitc commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Finishes the port to Erlang/OTP 28 and 29 with the latest hackney and the stdlib json module.

OTP 28/29

  • Replace all standalone catch expressions with try ... catch ... end (the case catch decode becomes try ... of ... catch), clearing the new OTP 29 deprecated-catch warnings.
  • CI matrix adds OTP 29.0 (Linux and macOS); FreeBSD already runs OTP 28.

hackney 2.0.1 to 4.2.2

hackney 4.x changes the response model, so this is more than a version bump:

  • Normal requests read the body eagerly and return {ok, Status, Headers, Body} (4th element is the body binary, not a connection pid). db_resp/2, json_body/1, and the call sites are updated accordingly.
  • hackney:skip_body/1 was removed; those calls are dropped since the body is read directly.
  • Pull-based response streaming after a normal GET is gone. Multipart open_doc, fetch_attachment/stream_attachment with stream, and stream_doc are reworked onto hackney's async ({async, once}) mode via a small pull shim in couchbeam_httpc (stream_request/5, stream_body/1, stream_body_all/1). The public streaming API is unchanged.
  • Views and changes already used async mode; only their dead skip_body cleanups were replaced with hackney:close/1.

Tests

  • meck bumped to 1.2.0 (0.9.2 does not build on OTP 29). Test mocks updated to the eager-body shapes.

Verification

  • OTP 29: clean compile, xref clean, dialyzer clean, all 32 eunit tests pass.
  • OTP 28: all 32 eunit tests pass.

Version bumped to 2.1.0.

benoitc added 3 commits June 9, 2026 14:24
- replace deprecated standalone catch with try/catch (OTP 29)
- migrate to hackney 4.2.2: eager response bodies, drop skip_body/1
- rework pull-based streaming downloads (multipart open_doc,
  fetch_attachment/stream_attachment, stream_doc) onto hackney async mode
- bump meck to 1.2.0 for OTP 29, update test mocks to eager-body shapes
- add OTP 29 to CI matrix, bump version to 2.1.0
- couchbeam_view: gate {async, once} streaming on the owner's stream_next
  so the stream process stays alive until the first batch is consumed
  (it was racing to exit, which broke stream_next/1)
- integration suite: drop removed hackney:skip_body/1 in create_mango_index
- FreeBSD CI: pkg upgrade before install to fix the git/pcre2 ABI mismatch
@benoitc benoitc merged commit dfab95c into master Jun 9, 2026
8 checks passed
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.

1 participant