Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cue context should be able to have an independent index #1414

Closed
leejanee opened this issue Dec 6, 2021 · 1 comment
Closed

Cue context should be able to have an independent index #1414

leejanee opened this issue Dec 6, 2021 · 1 comment

Comments

@leejanee
Copy link

leejanee commented Dec 6, 2021

Is your feature request related to a problem? Please describe.

When using cuelang on the server side , the program needs to execute cue file continuously and concurrently, but now cue context use the shared index , and it is currently not thread-safe.

Describe the solution you'd like

Cue context should be able to have an independent index. Actually you should use the same context if want to share the index.

import "cuelang.org/go/cue/cuecontext"

ctx:=cuecontext.New()

Describe alternatives you've considered

The sharedIndex is not concurrently safe, the following errors will occur.
image

Additional context
Add any other context or screenshots about the feature request here.

@leejanee leejanee added FeatureRequest New feature or request Triage Requires triage/attention labels Dec 6, 2021
@mpvl mpvl added this to the v0.4.2 api changes milestone Dec 14, 2021
cueckoo pushed a commit that referenced this issue Dec 17, 2021
This was currently only not allowed for imports.

Really import indices should be unique per context, but
even in that case, concurrency should be allowed.

Fixes #1414

Signed-off-by: Marcel van Lohuizen <mpvl@golang.org>

Change-Id: I944357c7b68cd242d19b323a1380c751a7fe49a5
@mpvl mpvl modified the milestones: v0.4.2, v0.4.1: bug fixes Dec 17, 2021
@mpvl mpvl added NeedsFix and removed FeatureRequest New feature or request Triage Requires triage/attention labels Dec 17, 2021
@cueckoo cueckoo closed this as completed in 25cfb20 Jan 6, 2022
@myitcv
Copy link
Member

myitcv commented Jan 6, 2022

We have just cut https://github.com/cue-lang/cue/releases/tag/v0.4.1-rc.1 with a fix for this.

Please test and let us know how you get on.

cueckoo pushed a commit that referenced this issue Feb 19, 2022
This was always supposed to be this way, but dropped off
the radar as a thing to do.

Fixes #1424
Fixes #1418
Issue #1414

Signed-off-by: Marcel van Lohuizen <mpvl@golang.org>

Change-Id: I25b486d2ea1c6009b00732a113af29bd485f9df5
cueckoo pushed a commit that referenced this issue Feb 22, 2022
This was always supposed to be this way, but dropped off
the radar as a thing to do.

Fixes #1424
Fixes #1418
Issue #1414

Signed-off-by: Marcel van Lohuizen <mpvl@golang.org>

Change-Id: I25b486d2ea1c6009b00732a113af29bd485f9df5
Signed-off-by: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/533473
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants