You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Issue Observed
--------------
When multiple goroutines uses different `Project` instances concurrently,
Go's race detector complains data races.
Issue Detail
------------
`schema_helpers.go` have some global variables and they are initialized
by `setupSchemaLoaders()` when `validate()` and other schema functions
are called for the first time.
However, `setupSchemaLoaders()` does not have mutex, so some times
multiple gorutines proceed into this function, then a race happens.
Suggested Resolution
--------------------
We can add a mutex to `setupSchemaLoader()` to avoid the race condition.
However, the function is supposed to cache results and called not so
many times. Therefore, in this patch, we simply initialize schemas in
`init()`.
Signed-off-by: Iwasaki Yudai <[email protected]>
0 commit comments