这是indexloc提供的服务,不要输入任何密码
Skip to content

Frequent crashes when building #936

@ObsidianX

Description

@ObsidianX

What version of Turborepo are you using?

1.1.2

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Linux

Describe the Bug

When running turbo run build on a monorepo with multiple workspaces I'm frequently seeing turbo crashing with ~90k lines of stacktraces:

runtime: program exceeds 10000-thread limit
fatal error: thread exhaustion

runtime stack:
runtime.throw({0x8dc802, 0x430916})
	runtime/panic.go:1198 +0x71
runtime.checkmcount()
	runtime/proc.go:760 +0x8c
runtime.mReserveID()
	runtime/proc.go:776 +0x36
runtime.startm(0xc00008d000, 0x0)
	runtime/proc.go:2477 +0x90
runtime.handoffp(0xc0ffffffff)
	runtime/proc.go:2519 +0x2ac
runtime.retake(0x1c0b3abbd73f)
	runtime/proc.go:5537 +0x1e7
runtime.sysmon()
	runtime/proc.go:5445 +0x333
runtime.mstart1()
	runtime/proc.go:1407 +0x93
runtime.mstart0()
	runtime/proc.go:1365 +0x79
runtime.mstart()
	runtime/asm_amd64.s:248 +0x5

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc0030150e0)
	runtime/sema.go:56 +0x25
sync.(*WaitGroup).Wait(0xc003d86000)
	sync/waitgroup.go:130 +0x71
turbo/internal/cache.(*asyncCache).Shutdown(0xc0038d7dd0)
	turbo/internal/cache/async_cache.go:64 +0x33
turbo/internal/run.(*RunCommand).Run(0xc0000ad850, {0xc00001e1a0, 0x1, 0x1})
	turbo/internal/run/run.go:680 +0x236b
github.com/mitchellh/cli.(*CLI).Run(0xc0000ff900)
	github.com/mitchellh/cli@v1.1.2/cli.go:262 +0x5f8
main.main.func7({0x0, 0x8d6360}, {0xc00001e190, 0x819510, 0x2}, {0x0, 0xc00000e020}, {0x0, 0x0}, 0xc0000ff900, ...)
	turbo/cmd/turbo/main.go:154 +0x385
main.main()
	turbo/cmd/turbo/main.go:159 +0x9e9

The goroutine stacktrace is repeated tens of thousands of times.

The crash is not 100% reproducible and rerunning the build both in local development and on CI will eventually get a complete build.

Expected Behavior

No crashes to occur

To Reproduce

I'm not sure what's triggering this crash since it's not 100% reproducible, but I've got a Yarn-based repo with about 15 workspaces that it's attempting to build via turbo run build.

Metadata

Metadata

Assignees

Labels

kind: bugSomething isn't workingneeds: investigationThe bug / idea needs more investigation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions