Skip to content

Commit

Permalink
fix: prevent deadlock when resetting the ServiceRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
sudorandom committed Nov 6, 2024
1 parent b4e3ecc commit f2e8d0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion private/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ func NewServiceRegistry() (*serviceRegistry, error) {

func (r *serviceRegistry) Reset() error {
r.lock.Lock()
defer r.lock.Unlock()
r.services = map[string]protoreflect.ServiceDescriptor{}
r.files = new(protoregistry.Files)
r.filesOrdered = []protoreflect.FileDescriptor{}
r.lock.Unlock()
return AddServicesFromGlobal(r)
}

Expand Down

0 comments on commit f2e8d0b

Please sign in to comment.