Skip to content

Commit

Permalink
start span before mutex lock
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Pickett committed Dec 11, 2024
1 parent ed176a3 commit 7885001
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ee/tpmrunner/tpmrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ func clearKeyData(slogger *slog.Logger, deleter types.Deleter) {
}

func (tr *tpmRunner) loadOrCreateKeys(ctx context.Context) error {
tr.mux.Lock()
defer tr.mux.Unlock()

ctx, span := traces.StartSpan(ctx)
defer span.End()

tr.mux.Lock()
defer tr.mux.Unlock()

priData, pubData, err := fetchKeyData(tr.store)
if err != nil {
thisErr := fmt.Errorf("fetching key data for data store: %w", err)
Expand Down

0 comments on commit 7885001

Please sign in to comment.