Skip to content

Comments

BCFR-1201 bind lp filter fix race#17095

Merged
ilija42 merged 7 commits intodevelopfrom
BCFR-1201
Apr 3, 2025
Merged

BCFR-1201 bind lp filter fix race#17095
ilija42 merged 7 commits intodevelopfrom
BCFR-1201

Conversation

@Unheilbar
Copy link
Collaborator

@Unheilbar Unheilbar commented Apr 3, 2025

This PR fixes bug from this ticket

@Unheilbar Unheilbar marked this pull request as ready for review April 3, 2025 11:16
@Unheilbar Unheilbar requested review from a team as code owners April 3, 2025 11:16
@Unheilbar Unheilbar requested review from Farber98 and ilija42 April 3, 2025 15:20
Copy link
Contributor

@Farber98 Farber98 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'd wait Ilija's or Domino's reviews before approving


r.dirty = true

r.filter.Addresses = append(r.filter.Addresses, address)
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we should have some sort of check here to make sure the address isn't already in the list (or perhaps, use a set instead of a list?).

I'm not sure how often we unregister and re-register the same filter, but if it's a lol then we'll keep appending more and more copies of the same address onto the list.

Copy link
Collaborator Author

@Unheilbar Unheilbar Apr 3, 2025

Choose a reason for hiding this comment

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

Good point, I noticed this is already handled by common and event readers (since they make precheck that address is bounded). So it won't keep appending copies at least in its current usage

Copy link
Contributor

Choose a reason for hiding this comment

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

Prior to this PR yes, but with the introduction of this PR it becomes possible. I'll comment above on the place where the check is removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

That said, it doesn't pose any serious problem so if you want to leave it as-is I'm okay with that.

ilija42
ilija42 previously approved these changes Apr 3, 2025
@ilija42 ilija42 requested review from a team, Farber98 and reductionista April 3, 2025 21:14
}

cb.registrar.SetName(logpoller.FilterName(cb.name + "." + uuid.NewString()))
cb.registrar.AddAddress(binding)
Copy link
Contributor

Choose a reason for hiding this comment

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

Here is what I was referring to below. Previously, we were calling cb.Unregister which calls RemoveAddress before calling AddAddress, so it gets removed and then re-added--you can't add the same one twice. But now we skip the isBound so it can be added multiple times. Right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cb.Unregister() doesn't call RemoveAddress, we cant add address multiple times because of
if cb.bindingExists(binding) { continue }

@cl-sonarqube-production
Copy link

@ilija42 ilija42 added this pull request to the merge queue Apr 3, 2025
Merged via the queue into develop with commit 8dfedde Apr 3, 2025
189 of 192 checks passed
@ilija42 ilija42 deleted the BCFR-1201 branch April 3, 2025 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants