Skip to content

Adapt to msgpack 1.2.0 - #3167

Merged
phoebusm merged 3 commits into
masterfrom
adapt_to_msgpack_1.2.0
Jun 12, 2026
Merged

Adapt to msgpack 1.2.0#3167
phoebusm merged 3 commits into
masterfrom
adapt_to_msgpack_1.2.0

Conversation

@phoebusm

@phoebusm phoebusm commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Reference Issues/PRs

Fix test_deep_nesting_metastruct_size_over_limit and test_deep_nesting_metastruct_size_under_limit
Culprit: msgpack 1.2.0 has just released. It includes Raise DEFAULT_RECURSE_LIMIT from 511 to 1024 by Copilot · Pull Request #676 · msgpack/msgpack-python
which changes DEFAULT_RECURSE_LIMIT from 511 to 1024
python 3.9 is unaffected as the new msgpack version has dropped the support

What does this implement or fix?

Hard-pin the arcticdb limit to 511 as msgpack <1.2.0

Any other comments?

msgpack <1.2.0 has the recurse limit set at 511. arcticdb imports the limit from msgpack to calculate the metastruct layer limit
msgpack 1.2.0 has raised limit from 511 to 1024. Since reconstructing the metastruct from is done by recursion, increasing the no. of layers in the metastruct will make arcticdb hit the python recursion limit.

Checklist

Checklist for code changes...
  • Have you updated the relevant docstrings, documentation and copyright notice?
  • Is this contribution tested against all ArcticDB's features?
  • Do all exceptions introduced raise appropriate error messages?
  • Are API changes highlighted in the PR description?
  • Is the PR labelled as enhancement or bug so it appears in autogenerated release notes?

@phoebusm phoebusm added the patch Small change, should increase patch version label Jun 11, 2026
@phoebusm
phoebusm force-pushed the adapt_to_msgpack_1.2.0 branch from d833ac2 to ad918ea Compare June 11, 2026 16:28
@phoebusm
phoebusm marked this pull request as ready for review June 11, 2026 17:13
@claude

claude Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

ArcticDB Code Review Summary

Reviewed the full diff (opened/ready_for_review). The change pins the recursive-normalizer nesting cap to msgpack's historical 511 (min(511, _DEFAULT_RECURSE_LIMIT)), so the effective 255-level limit is preserved even with msgpack 1.2.0's raised default. The logic is correct, the only consumers (flattener.py, the test) stay consistent, and the tests now derive their expected values from the constant while still exercising the same 255-allowed / 256-rejected boundary.

No blocking issues found.

PR Title & Description

  • patch is the only label. This change does alter write behaviour when msgpack 1.2.0 is installed (rejecting 256-511-level nesting that would otherwise be written but could not be read back). Consider whether bug / release-notes labelling is warranted, or no-release-notes if this is a pure compatibility fix. (non-blocking)

@IvoDD IvoDD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you only add no-release-notes label as this is not user facing.

# DEFAULT_RECURSE_LIMIT broke when msgpack 1.2.0 raised it to 1024, letting writes through at depths the
# reader could not reconstruct.
# https://man312219.monday.com/boards/7852509418/pulses/12254825163
DEFAULT_RECURSE_LIMIT = min(511, _DEFAULT_RECURSE_LIMIT)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this explanation confusing. The recursion limit has always been 1000

As far as I understand the problem is that our metastruct reader uses 3 stackframe recursion so we reach the limit at around 330.

Should we just set the threshold for nesting to something like (DEFAULT_RECURSION_LIMIT - 10) // 3? The 10 is for the stack frames which call the decoding code.

After we fix our metastruct reading to not be recursive we will be able to return it to the (DEFAULT_RECURSION_LIMIT - 10) // 2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway I'm fine with the current fix to unblock the CI and it essentially preserves the old limit.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the comment to better explain the write and read limits

@phoebusm
phoebusm force-pushed the adapt_to_msgpack_1.2.0 branch from cfaba39 to 0b6a573 Compare June 12, 2026 14:00
@phoebusm phoebusm added the no-release-notes This PR shouldn't be added to release notes. label Jun 12, 2026
@phoebusm
phoebusm merged commit 5372ec5 into master Jun 12, 2026
437 of 439 checks passed
@phoebusm
phoebusm deleted the adapt_to_msgpack_1.2.0 branch June 12, 2026 23:32
IvoDD added a commit that referenced this pull request Jun 17, 2026
#### Reference Issues/PRs
<!--Example: Fixes #1234. See also #3456.-->
Fix `test_deep_nesting_metastruct_size_over_limit` and
`test_deep_nesting_metastruct_size_under_limit`
Culprit: `msgpack 1.2.0` has just released. It includes [Raise
DEFAULT_RECURSE_LIMIT from 511 to 1024 by Copilot · Pull Request #676 ·
msgpack/msgpack-python](msgpack/msgpack-python#676)
which changes `DEFAULT_RECURSE_LIMIT` from 511 to 1024 `python 3.9` is
unaffected as the new msgpack version has dropped the support

#### What does this implement or fix?
Hard-pin the arcticdb limit to `511` as msgpack <1.2.0 #### Any other
comments?
msgpack <1.2.0 has the recurse limit set at 511. arcticdb imports the
limit from msgpack to calculate the metastruct layer limit msgpack 1.2.0
has raised limit from 511 to 1024. Since reconstructing the metastruct
from is done by recursion, increasing the no. of layers in the
metastruct will make arcticdb hit the python recursion limit. ####
Checklist

<details>
  <summary>
   Checklist for code changes...
  </summary>
 
- [ ] Have you updated the relevant docstrings, documentation and
copyright notice?
- [ ] Is this contribution tested against [all ArcticDB's
features](../docs/mkdocs/docs/technical/contributing.md)?
- [ ] Do all exceptions introduced raise appropriate [error
messages](https://docs.arcticdb.io/error_messages/)?
 - [ ] Are API changes highlighted in the PR description?
- [ ] Is the PR labelled as enhancement or bug so it appears in
autogenerated release notes?
</details>

<!--
Thanks for contributing a Pull Request to ArcticDB! Please ensure you
have taken a look at:
- ArcticDB's Code of Conduct:
https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md
- ArcticDB's Contribution Licensing:
https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing
-->

#### Reference Issues/PRs
<!--Example: Fixes #1234. See also #3456.-->

#### What does this implement or fix?

#### Any other comments?

#### Checklist

<details>
  <summary>
   Checklist for code changes...
  </summary>
 
- [ ] Have you updated the relevant docstrings, documentation and
copyright notice?
- [ ] Is this contribution tested against [all ArcticDB's
features](../docs/mkdocs/docs/technical/contributing.md)?
- [ ] Do all exceptions introduced raise appropriate [error
messages](https://docs.arcticdb.io/error_messages/)?
 - [ ] Are API changes highlighted in the PR description?
- [ ] Is the PR labelled as enhancement or bug so it appears in
autogenerated release notes?
</details>

<!--
Thanks for contributing a Pull Request to ArcticDB! Please ensure you
have taken a look at:
- ArcticDB's Code of Conduct:
https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md
- ArcticDB's Contribution Licensing:
https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing
-->

Co-authored-by: Phoebus Mak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release-notes This PR shouldn't be added to release notes. patch Small change, should increase patch version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants