Panic seen in the wild while calling math/rand's Intn(..)

Description

The following panic was observed in a 6.5.0 cluster, the exact steps leading to it have not been confirmed. See for more details.

The panic corresponds to this line in our code:

https://github.com/couchbase/cbft/blob/mad-hatter/grpc_util.go#L121


We haven't seen this stack trace before, but from some online reading - it seems golang's math/rand's NewSource may not be thread safe (https://pkg.go.dev/math/rand).

Components

Affects versions

Fix versions

Labels

Environment

None

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Show:

CB robot November 7, 2022 at 11:30 PM

Build couchbase-server-7.1.3-3471 contains n1fty commit 1a61e24 with commit message:
: [BP] rand.NewSource is NOT thread safe

CB robot November 7, 2022 at 11:30 PM

Build couchbase-server-7.1.3-3471 contains cbft commit b190fad with commit message:
: [BP] rand.NewSource is NOT thread safe

CB robot November 7, 2022 at 11:17 PM

Build couchbase-server-7.2.0-5013 contains n1fty commit 1a61e24 with commit message:
: [BP] rand.NewSource is NOT thread safe

CB robot November 7, 2022 at 11:17 PM

Build couchbase-server-7.2.0-5013 contains cbft commit b190fad with commit message:
: [BP] rand.NewSource is NOT thread safe

Abhi Dangeti November 7, 2022 at 9:07 PM
Edited

This ticket is a clone of which we've addressed in 7.0.5. Seeing that 7.1.3 is in line next for release, we must include this fix. Pending your approval, I can merge the fixes into the neo branches for couchbase/cbft and couchbase/n1fty.

 

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Is this a Regression?

No

Triage

Untriaged

Story Points

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created October 26, 2022 at 11:01 PM
Updated August 31, 2024 at 11:07 AM
Resolved November 7, 2022 at 10:47 PM
Instabug