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

opt: relax max stack size in test for stack overflow #133241

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

mgartner
Copy link
Collaborator

@mgartner mgartner commented Oct 23, 2024

This commit relaxes the maximum Go stack size in bytes for a test added
in #132701 from 50KB to 125KB. The very low max stack size was causing
stack overflows to occur in unrelated functions, like parsing, in some
nightly tests. I'm hoping that more than doubling this will eliminate
the flakes.

Fixes #133212

Release note: None

@mgartner mgartner requested a review from a team October 23, 2024 11:38
@mgartner mgartner requested a review from a team as a code owner October 23, 2024 11:38
@mgartner mgartner requested review from mw5h and removed request for a team October 23, 2024 11:38
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner mgartner added backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2 backport-24.3.x Flags PRs that need to be backported to 24.3 labels Oct 23, 2024
@mgartner
Copy link
Collaborator Author

Friendly ping @mw5h :)

Copy link
Contributor

@mw5h mw5h left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)


-- commits line 5 at r1:
I think you mean 125KB.


pkg/sql/opt/xform/testdata/rules/select line 2823 at r1 (raw file):

# `IN` list below huge - triggering a stack overflow with Go's default max stack
# size requires a list of ~1.6 million elements.
opt max-stack=125KB format=hide-all

Do we not care about powers of two in Go?

This commit relaxes the maximum Go stack size in bytes for a test added
in cockroachdb#132701 from 50KB to 125KB. The very low max stack size was causing
stack overflows to occur in unrelated functions, like parsing, in some
nightly tests. I'm hoping that more than doubling this will eliminate
the flakes.

Fixes cockroachdb#133212

Release note: None
@mgartner mgartner force-pushed the 133212-relax-max-stack-test branch from 7cb0ecb to b5b7606 Compare October 29, 2024 19:19
@mgartner mgartner requested a review from mw5h October 29, 2024 19:20
Copy link
Collaborator Author

@mgartner mgartner left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @mw5h)


-- commits line 5 at r1:

Previously, mw5h (Matt White) wrote…

I think you mean 125KB.

Done.


pkg/sql/opt/xform/testdata/rules/select line 2823 at r1 (raw file):

Previously, mw5h (Matt White) wrote…

Do we not care about powers of two in Go?

What were you thinking? I don't know why using a power of 2 would be relevant here.

Copy link
Contributor

@mw5h mw5h left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @mgartner)


pkg/sql/opt/xform/testdata/rules/select line 2823 at r1 (raw file):

Previously, mgartner (Marcus Gartner) wrote…

What were you thinking? I don't know why using a power of 2 would be relevant here.

It's probably not. In a runtime where the stack size is static, I'd want want that so that my stacks are all cache & page aligned without wastage.

@mgartner
Copy link
Collaborator Author

mgartner commented Oct 29, 2024

It's probably not. In a runtime where the stack size is static, I'd want want that so that my stacks are all cache & page aligned without wastage.

I see. This setting only controls the size limit of stacks in bytes, AFAIK.

bors r+

@craig craig bot merged commit d3409d8 into cockroachdb:master Oct 29, 2024
21 of 23 checks passed
Copy link

blathers-crl bot commented Oct 29, 2024

Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches.


Issue #133212: branch-release-23.1, branch-release-23.2, branch-release-24.1, branch-release-24.3.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@mgartner mgartner deleted the 133212-relax-max-stack-test branch October 29, 2024 20:45
@yuzefovich
Copy link
Member

blathers backport release-23.2.15-rc

@yuzefovich
Copy link
Member

blathers backport release-23.1.29-rc

mgartner added a commit to mgartner/cockroach that referenced this pull request Nov 5, 2024
The `max-stack` opt tester option now run the test command in a separate
goroutine. A fresh stack makes tests using this setting more reliable.

It also reverts the increase of `max-stack` of a test from cockroachdb#133241
because it is no longer necessary.

Release note: None
mgartner added a commit to mgartner/cockroach that referenced this pull request Nov 5, 2024
The `max-stack` opt tester option now run the test command in a separate
goroutine. A fresh stack makes tests using this setting more reliable.

It also reverts the increase of `max-stack` of a test from cockroachdb#133241
because it is no longer necessary.

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2 backport-24.3.x Flags PRs that need to be backported to 24.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql/opt/xform: TestRules failed
4 participants