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

Fix deadlock on ModuleData methods #2709

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions private/bufpkg/bufmodule/module_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,13 @@ func newModuleData(
var actualDigest Digest
switch expectedDigest.Type() {
case DigestTypeB4:
bufYAMLObjectData, err := moduleData.BufYAMLObjectData()
// Call unexported func instead of exported method to avoid deadlocking on checking the digest again.
bufYAMLObjectData, err := moduleData.getBufYAMLObjectData()
if err != nil {
return err
}
bufLockObjectData, err := moduleData.BufLockObjectData()
// Call unexported func instead of exported method to avoid deadlocking on checking the digest again.
bufLockObjectData, err := moduleData.getBufLockObjectData()
if err != nil {
return err
}
Expand All @@ -136,6 +138,7 @@ func newModuleData(
return err
}
case DigestTypeB5:
// Call unexported func instead of exported method to avoid deadlocking on checking the digest again.
declaredDepModuleKeys, err := moduleData.getDeclaredDepModuleKeys()
if err != nil {
return err
Expand Down
Loading