cockroachdb / cockroachdb/cockroach

Reduce Go maximum stack size in roachtest

Open
#132,790 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

One class of problem that occurs in the field is an OOM due to excessive Go stack size. Usually these stacks are the result of unexpected levels of recursion. By default, Go on a 64bit host allows the stack to grow up to 1GB (effectively unlimited). In order to detect code paths that can lead to runaway stack sizes, let's reduce the stack size used during roachtest to something fairly constrained, the exact amount to be determined experimentally.

The idea is to detect points of costly recursion during testing so that this recursion can be refactored before it causes a problem at a customer site.

The API for adjusting the Go maximum stack size is available in the debug package: [SetMaxStack()](https://pkg.go.dev/runtime/debug#SetMaxStack)

Jira issue: CRDB-43278

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.