Skip to content

*: ban the go keyword in non-test code #58164

@jordanlewis

Description

@jordanlewis

Misuse of the go keyword is problematic for a server that desires to be HA like CockroachDB: a panic-causing stack on the resultant goroutine will crash the entire process without custom crash handling.

There are already several wrappers for go throughout the codebase, such as Tasks and Workers creatable by the stopper. These wrappers perform cleanup and report errors to sentry, and can be extended over time. Unfortunately, they're not used consistently, and their use is not enforced.

This ticket tracks removing the go keyword from non-test code, except for the packages that implement the wrappers, and adding a linter that bans direct use of the go keyword except for in those places.

Jira issue: CRDB-3425

Metadata

Metadata

Assignees

Labels

C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)S-3-productivitySevere issues that impede the productivity of CockroachDB developers.T-server-and-securityDB Server & SecurityT-sql-queriesSQL Queries Teamquality-fridayA good issue to work on on Quality Friday

Type

No type

Projects

Status

Bugs to Fix

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions