Race detected while upgrading cuelang #3970
Unanswered
rsmith-cs-ux
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Cue version:
Issue:
I've been trying to upgrade our version of cue from 0.4.3 to 0.13.1 and have been running into a lot of issues with race conditions using the Go api. Our code is highly parallelized using golang.org/x/sync/errgroup and we're currently calling
v.FillPath()
before deserializing to a Go struct. Everything "works" (no panics) but one of our tests consistently throws a data race error that is quite troubling and I've tried a number of ways to get rid of it with no success.Here's the stack trace that I'm seeing:
If I put a mutex around
FillPath
then the race is no longer an issue, but doing so kills our performance since we have many different cue definitions that are being evaluated by this service in parallel. Some take several minutes to complete, which in our case doesn't work.I have been attempting to clone the cue.Context from the existing cue.Value (just to see if that would work). Here's the code I was trying to use to accomplish the clone:
Unfortunately, the syntax that is generated is invalid because the
sourceBytes
contains comments with// explicit error (_|_ literal) in source
.I'm sure I'm doing something wrong, I just don't know what that might be or if there is another (hopefully better) way of handling this race condition. Thanks in advance for any help you can provide!
Beta Was this translation helpful? Give feedback.
All reactions