Adapt to msgpack 1.2.0 - #3167
Conversation
d833ac2 to
ad918ea
Compare
ArcticDB Code Review SummaryReviewed the full diff ( No blocking issues found. PR Title & Description
|
IvoDD
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Anyway I'm fine with the current fix to unblock the CI and it essentially preserves the old limit.
There was a problem hiding this comment.
I have updated the comment to better explain the write and read limits
cfaba39 to
0b6a573
Compare
#### 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]>
Reference Issues/PRs
Fix
test_deep_nesting_metastruct_size_over_limitandtest_deep_nesting_metastruct_size_under_limitCulprit:
msgpack 1.2.0has just released. It includes Raise DEFAULT_RECURSE_LIMIT from 511 to 1024 by Copilot · Pull Request #676 · msgpack/msgpack-pythonwhich changes
DEFAULT_RECURSE_LIMITfrom 511 to 1024python 3.9is unaffected as the new msgpack version has dropped the supportWhat does this implement or fix?
Hard-pin the arcticdb limit to
511as msgpack <1.2.0Any 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...