Skip to content

MessageDigest is not thread safe and for the same input, it can generate different hash #816

Closed
@hamid646m

Description

@hamid646m

MessageDigest is not thread safe, therefore if there are multiple requests in quick succession, different hash is returned for the same input.

Consequently, idempotent contract is broken and requests are treated as new for the same IdempotentKey

Expected Behavior

For the same IdempotentKey, same hash must be generated.

When generating Hash value, a new instance of MessageDigest should be used.

I am creating a PR to fix this issue.

this here explain thread safety issue of MessageDigest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions