Skip to content

Use the name of the StoreType to do hashcode#2009

Merged
sswguo merged 1 commit intoCommonjava:2.6.xfrom
sswguo:debug_depulicated_job
Dec 28, 2021
Merged

Use the name of the StoreType to do hashcode#2009
sswguo merged 1 commit intoCommonjava:2.6.xfrom
sswguo:debug_depulicated_job

Conversation

@sswguo
Copy link
Copy Markdown
Contributor

@sswguo sswguo commented Dec 28, 2021

The following logs are from stage, which shows two transfers with the same uri and path but different hashcode, that causes the duplicated download jobs for the same transfer, let's use the name of StoreType to do hashcode instead.

Transfer uri: https://repository.engineering.redhat.com/nexus/repository/registry.npmjs.org/
Transfer path: glob/-/glob-7.1.6.tgz
Transfer hashCode: 1913094049
----------------
Transfer uri: https://repository.engineering.redhat.com/nexus/repository/registry.npmjs.org/
Transfer path: glob/-/glob-7.1.6.tgz
Transfer hashCode: 159836173

@sswguo sswguo requested a review from ruhan1 December 28, 2021 05:49
Copy link
Copy Markdown
Contributor

@ruhan1 ruhan1 left a comment

Choose a reason for hiding this comment

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

type is enum. its hashcode should be the object id. this id won't change in the lifetime of a jvm. but type.name is a better idea.

@sswguo
Copy link
Copy Markdown
Contributor Author

sswguo commented Dec 28, 2021

type is enum. its hashcode should be the object id. this id won't change in the lifetime of a jvm. but type.name is a better idea.

It looks it uses the hashcode of Object, but it should not change in the same JVM, I will have a test with this. thanks.

@sswguo sswguo merged commit 5538645 into Commonjava:2.6.x Dec 28, 2021
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