Skip to content

Avoid hash code collisions in build memory - #360

Open
Jimilian wants to merge 3 commits into
jenkinsci:masterfrom
Jimilian:hash_collision
Open

Avoid hash code collisions in build memory#360
Jimilian wants to merge 3 commits into
jenkinsci:masterfrom
Jimilian:hash_collision

Conversation

@Jimilian

@Jimilian Jimilian commented May 2, 2018

Copy link
Copy Markdown
Contributor

Time to time we observe very strange behaviour - when completely new patchset is triggered, it already has some finished builds in the history. We assume that it may be related due to TreeMap nature of BuildMemory.

@Jimilian

Jimilian commented May 2, 2018

Copy link
Copy Markdown
Contributor Author

{event1, null, 2},
{event1, event1, 1},
{event2, event2, 1},
{event1, event2, 2},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be one, if they have the same hashcode, they essentially are the same event even though it is different object instances.
An event might be just one instance when a series of builds are triggered, but when those builds are restored from disk the events in those builds will be different instances, and the quick way to see that two instances respresents the same event is to use the hashCode.

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.

2 participants