Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Allow higher recursion limits. #58

Closed
1 task done
ielashi opened this issue Oct 7, 2022 · 0 comments · Fixed by #84
Closed
1 task done

[Feature]: Allow higher recursion limits. #58

ielashi opened this issue Oct 7, 2022 · 0 comments · Fixed by #84
Labels
enhancement New feature or request

Comments

@ielashi
Copy link

ielashi commented Oct 7, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Description

Hey everyone!

I have a use-case where I am deserializing a recursive data structure. The data I'm deserializing can become quite deep, to the point where I'm running into the RecursionLimitExceeded errors when deserializing.

I'm aware there's a risk in increasing the recursion limit of 256. In my particular case, increasing that limit would solve my issue.

Acceptance Criteria

No response

Suggestions for a technical implementation

I can see a few solutions to address this:

  1. Add a new method with the following signature to deserialize with a specific recursion limit:
pub fn from_reader_with_recursion_limit<T: de::DeserializeOwned, R: Read>(reader: R, recurse: usize) -> Result<T, Error<R::Error>
  1. Add a feature, say no_recursion_limit, and if this feature is enabled, the recurse value is set to usize::MAX, effectively disabling the recursion limit check.

  2. Increase the hard-coded value of recurse from 256 to, say, 512.

Thoughts? I'm happy to create a PR once we agree on an approach.

@ielashi ielashi added the enhancement New feature or request label Oct 7, 2022
@dpal dpal added this to Enarx Board Jan 26, 2023
@dpal dpal moved this to New in Enarx Board Jan 26, 2023
daviddrysdale added a commit to daviddrysdale/ciborium that referenced this issue May 17, 2023
This change adds a from_reader_with_recursion_limit() variant of
from_reader(), allowing the maximum recursion limit to be set
explicitly.

Fixes enarx#58
daviddrysdale added a commit to daviddrysdale/ciborium that referenced this issue May 17, 2023
This change adds a from_reader_with_recursion_limit() variant of
from_reader(), allowing the maximum recursion limit to be set
explicitly.

Fixes enarx#58 which asks for the ability to set a higher recursion limit,
but this is mainly intended for environments where the default limit
of 256 is too large (i.e. the stack gets exhausted before the limit is
hit).
daviddrysdale added a commit to daviddrysdale/ciborium that referenced this issue May 17, 2023
This change adds a from_reader_with_recursion_limit() variant of
from_reader(), allowing the maximum recursion limit to be set
explicitly.

Fixes enarx#58 which asks for the ability to set a higher recursion limit,
but this is mainly intended for environments where the default limit
of 256 is too large (i.e. the stack gets exhausted before the limit is
hit).
daviddrysdale added a commit to daviddrysdale/ciborium that referenced this issue May 17, 2023
This change adds a from_reader_with_recursion_limit() variant of
from_reader(), allowing the maximum recursion limit to be set
explicitly.

Fixes enarx#58 which asks for the ability to set a higher recursion limit,
but this is mainly intended for environments where the default limit
of 256 is too large (i.e. the stack gets exhausted before the limit is
hit).

Signed-off-by: David Drysdale <[email protected]>
daviddrysdale added a commit to daviddrysdale/ciborium that referenced this issue May 29, 2023
This change adds a from_reader_with_recursion_limit() variant of
from_reader(), allowing the maximum recursion limit to be set
explicitly.

Fixes: enarx#58 which asks for the ability to set a higher recursion limit,
but this is mainly intended for environments where the default limit
of 256 is too large (i.e. the stack gets exhausted before the limit is
hit).

Signed-off-by: David Drysdale <[email protected]>
@rjzak rjzak closed this as completed in #84 May 29, 2023
rjzak pushed a commit that referenced this issue May 29, 2023
This change adds a from_reader_with_recursion_limit() variant of
from_reader(), allowing the maximum recursion limit to be set
explicitly.

Fixes: #58 which asks for the ability to set a higher recursion limit,
but this is mainly intended for environments where the default limit
of 256 is too large (i.e. the stack gets exhausted before the limit is
hit).

Signed-off-by: David Drysdale <[email protected]>
@github-project-automation github-project-automation bot moved this from New to Done in Enarx Board May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant