You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after upgrading aws sdk from 0.x to 1.x, we started seeing stack overflows in our tests. After investigation, it seems aws_sdk_s3::config::endpoint::internals::resolve_endpoint creates a rather large frame, a bit over 1MiB. I haven't measured in release, but we don't see a stack overflow there, so it's likely optimizations improves that considerably
Expected Behavior
a more tame usage of the stack
Current Behavior
depending on how deep the stack is already, when calling into s3 sdk, possibly a stack overflow. No problem if there is enough place on the stack
Reproduction Steps
a minimal reproducer is hard to come by given you need an already fairly large stack to get a stack overflow. In https://github.com/quickwit-oss/quickwit/ before e8978dff7e9fe831f721785cf88f5ff03f0359bc, you can run make test-all to get the same error we got
Possible Solution
we increased RUST_MIN_STACK as a workaround.
Splitting aws_sdk_s3::config::endpoint::internals::resolve_endpoint (currently over 4300 lines) into smaller functions would likely improve its stack usage
thread 'test_all_with_s3_localstack_cli' has overflowed its stack
fatal runtime error: stack overflow
Canceling due to test failure: 7 tests still running
The text was updated successfully, but these errors were encountered:
Endpoint resolution logic is generated from a set of rules defined by the service team. S3 is a particularly complex example. My team is essentially writing a compiler but we aren't doing a good job when it comes to optimizing the output of that compiler.
The codegen code is located here. At a glance, I can see we're disabling some Clippy lints. Perhaps we could re-enable those and then run clippy --fix at the end of generation to get rid of some of the cruft.
I don't expect us to get to this issue soon, but I do think it's something that we should put in our backlog.
From a quick test, running cargo clippy --tests --all-features --fix on the S3 endpoint resolver brought the total lines down from 4,258 to 3,810 lines.
However, I also tested whether that solves this problem and the answer is no, it still overflows. 😢
Describe the bug
after upgrading aws sdk from 0.x to 1.x, we started seeing stack overflows in our tests. After investigation, it seems
aws_sdk_s3::config::endpoint::internals::resolve_endpoint
creates a rather large frame, a bit over 1MiB. I haven't measured in release, but we don't see a stack overflow there, so it's likely optimizations improves that considerablyExpected Behavior
a more tame usage of the stack
Current Behavior
depending on how deep the stack is already, when calling into s3 sdk, possibly a stack overflow. No problem if there is enough place on the stack
Reproduction Steps
a minimal reproducer is hard to come by given you need an already fairly large stack to get a stack overflow. In https://github.com/quickwit-oss/quickwit/ before e8978dff7e9fe831f721785cf88f5ff03f0359bc, you can run
make test-all
to get the same error we gotPossible Solution
we increased
RUST_MIN_STACK
as a workaround.Splitting
aws_sdk_s3::config::endpoint::internals::resolve_endpoint
(currently over 4300 lines) into smaller functions would likely improve its stack usageAdditional Information/Context
looks similar to #1082
Version
Environment details (OS name and version, etc.)
archlinux, github-actions...
Logs
The text was updated successfully, but these errors were encountered: