Skip to content

Commit a96b39f

Browse files
Merge pull request #1654 from kaleido-io/dxstatuscheck-deadlock-fix2
[dataexchange] Fixing Deadlock on Reconnect
2 parents e486b2e + 5684ee4 commit a96b39f

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

internal/dataexchange/ffdx/ffdx.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,12 @@ func (h *FFDX) beforeConnect(ctx context.Context, w wsclient.WSClient) error {
305305
}
306306
}
307307

308+
h.initialized = true
309+
308310
for _, cb := range h.callbacks.handlers {
309311
cb.DXConnect(h)
310312
}
311313

312-
h.initialized = true
313314
return nil
314315
}
315316

@@ -463,10 +464,6 @@ func (h *FFDX) TransferBlob(ctx context.Context, nsOpID string, peer, sender fft
463464
}
464465

465466
func (h *FFDX) CheckNodeIdentityStatus(ctx context.Context, node *core.Identity) error {
466-
if err := h.checkInitialized(ctx); err != nil {
467-
return err
468-
}
469-
470467
if node == nil {
471468
return i18n.NewError(ctx, coremsgs.MsgNodeNotProvidedForCheck)
472469
}

internal/dataexchange/ffdx/ffdx_test.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,17 +1102,9 @@ BAYTAkFVMRMwEQYDVQQIDApxdWVlbnNsYW5kMREwDwYDVQQHDAhCcm9va2ZpZWxk
11021102
assert.ErrorContains(t, err, "failed to parse non-certificate within bundle")
11031103
}
11041104

1105-
func TestCheckNodeIdentityStatusReturnsErrorWhenNotInitialized(t *testing.T) {
1106-
h := &FFDX{initialized: false}
1107-
err := h.CheckNodeIdentityStatus(context.Background(), &core.Identity{})
1108-
assert.Regexp(t, "FF10342", err)
1109-
}
1110-
11111105
func TestCheckNodeIdentityStatusNodeNil(t *testing.T) {
11121106
mmm := metricsmocks.NewManager(t)
1113-
1114-
h := &FFDX{initialized: true, metrics: mmm}
1115-
1107+
h := &FFDX{metrics: mmm}
11161108
err := h.CheckNodeIdentityStatus(context.Background(), nil)
11171109
assert.Error(t, err)
11181110
}

0 commit comments

Comments
 (0)