Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion internal/assets/token_pool.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 Kaleido, Inc.
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
7 changes: 6 additions & 1 deletion internal/definitions/handler_tokenpool.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 Kaleido, Inc.
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -92,6 +92,11 @@
}
}

if existing.ID.Equals(pool.ID) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to understand how we got to this point with a duplicate ID. Your description indicates we are processing a TokenPoolCreated event, so we're coming in via eventManager.TokenPoolCreated() and then definitionSender.DefineTokenPool() and then here.

But in eventManager.TokenPoolCreated(), there is a check for an existing pool. Is that check failing to find the existing pool and allowing it to get down to here?

Copy link
Contributor

@awrichar awrichar Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth confirming... were you running the latest release (v1.3.2) when you saw this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, running the latest v1.3.2 release

log.L(ctx).Warnf("Received duplicate token pool creation with ID=%s, ignoring and carrying on for token connector: %s", pool.ID, pool.Connector)
break

Check warning on line 97 in internal/definitions/handler_tokenpool.go

View check run for this annotation

Codecov / codecov/patch

internal/definitions/handler_tokenpool.go#L96-L97

Added lines #L96 - L97 were not covered by tests
}

// Any other conflict - reject
return HandlerResult{Action: core.ActionReject, CustomCorrelator: correlator}, i18n.NewError(ctx, coremsgs.MsgDefRejectedConflict, "token pool", pool.ID, existing.ID)
}
Expand Down
Loading