-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Return an error when adding the same asset label multiple times. #19485
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
base: main
Are you sure you want to change the base?
Conversation
…et name (since their paths are different).
32f14fd
to
b80279e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helpful fix, but the Mutex makes me nervous. Can you see any other viable solutions?
@alice-i-cecile Not really. The problem is that we need to be able to differentiate between immediate nested asset loads and their subassets, from "root asset" subassets. This was the thing I missed in #15481, and not something that's easy to fix without gross hacks. This solution has the advantage that as soon as you add a duplicate subasset, you'll get the feedback. I don't think we need to worry much about the Mutex. It's got quite a small critical section, and likely has very low contention (people are probably not adding many subassets from many threads), plus asset loading in general is IO-bound. |
b80279e
to
544f418
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for the justification :)
Objective
LoadContext
does not return an error. #19026.Solution
LoadContext
be a&Mutex<HashMap>
.LoadContext
s for subassets reuse the same&Mutex<HashMap>
.Mutex<HashMap>
, so their subassets will be managed separately.Testing