Skip to content

Commit

Permalink
fix: data race (#344)
Browse files Browse the repository at this point in the history
* fix: data race in module resolution

* somehow tests can end up with duplicate work items? if this ever
  happens i guess we just need to make sure we're only processing one at
  a time

* just kidding it was on the module
  • Loading branch information
George Shaw authored Jul 24, 2024
1 parent f5eb23a commit ad05f96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/modules/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ func work(ctx context.Context, opts *ModuleResolveOptions, item *workItem, wl *w
}

// set the module on our resolved module
item.inProgressResolution.mu.Lock()
item.inProgressResolution.Module = m
item.inProgressResolution.version = version
item.inProgressResolution.mu.Unlock()

log.WithFields(logrus.Fields{
"module": item.importPath,
Expand Down

0 comments on commit ad05f96

Please sign in to comment.