Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unmatched iterator in Cluster::SetClusterNodes #646

Merged
merged 2 commits into from
Jun 22, 2022

Conversation

PragmaTwice
Copy link
Member

No description provided.

Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

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

LGTM, good catch!

@ShooterIT
Copy link
Member

Hi @PragmaTwice is there a bug? what is its danger?

@PragmaTwice
Copy link
Member Author

PragmaTwice commented Jun 22, 2022

Hi @PragmaTwice is there a bug? what is its danger?

Yeah, it is an undefined behavior (to compare iterators from different containers), so the compiler and the standard library implementation can literally do anything, e.g. either return true or false, or even spend $1 from your mastercard 🤣 althought maybe libstdc++ and libc++ will not do that.
In some standard library implementation the end() iterator of a hashmap is just a nullptr, so the compare work well, but I means that I think we should not rely on a specific implementation and an undefined behavior.

@git-hulk
Copy link
Member

@ShooterIT I think we can disable the test cases which failed frequently before finding the root cause, how do you think?

@tisonkun
Copy link
Member

@git-hulk if so, we should hold a pinned issue to investigate and move forward fixing them.

@git-hulk
Copy link
Member

@git-hulk if so, we should hold a pinned issue to investigate and move forward fixing them.

OK, I'll submit an issue to find out those test cases, then submit another issue to track them.

Copy link
Member

@ShooterIT ShooterIT left a comment

Choose a reason for hiding this comment

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

my bad 🤦‍♂️ different variables

@PragmaTwice
Copy link
Member Author

Thanks everyone. Merging...

@PragmaTwice PragmaTwice merged commit 76e6355 into apache:unstable Jun 22, 2022
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