Skip to content

Commit

Permalink
fixed the deadlock
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Oct 25, 2023
1 parent ce5be5f commit c408c54
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions content/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (s *Store) Exists(ctx context.Context, target ocispec.Descriptor) (bool, er
}

// Delete removes the content matching the descriptor from the store. Delete may
// fail on some systems (i.e. Windows), if there is a process (i.e. an unclosed
// fail on certain systems (i.e. NTFS), if there is a process (i.e. an unclosed
// Reader) using `target`.
func (s *Store) Delete(ctx context.Context, target ocispec.Descriptor) error {
s.sync.Lock()
Expand Down Expand Up @@ -318,9 +318,6 @@ func (s *Store) loadIndexFile(ctx context.Context) error {
// - If AutoSaveIndex is set to false, it's the caller's responsibility
// to manually call this method when needed.
func (s *Store) SaveIndex() error {
s.sync.RLock()
defer s.sync.RUnlock()

s.indexLock.Lock()
defer s.indexLock.Unlock()

Expand Down

0 comments on commit c408c54

Please sign in to comment.