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

MD5 implementation is not thread safe #47

Merged
merged 1 commit into from
May 6, 2023

Conversation

SergeyGulik
Copy link

MD5 implementation is not thread safe. As a result ChangeId sometimes got same value for different observations under heavy multi-threaded test.
Made it thread-safe without blocking thread, but sacrificed some memory.
My particular problem happened in MTConnectAgent
private static bool FilterDelta
where condition
if (!ObjectExtensions.ByteArraysEqual(newObservation.ChangeId, existingObservation.ChangeId))
was false.

… got same value for different observations under heavy multi-threaded test.

Made it thread-safe without blocking thread, but sacrificed some memory.
@PatrickRitchie PatrickRitchie merged commit b258b42 into TrakHound:master May 6, 2023
@PatrickRitchie
Copy link
Contributor

Thanks for finding this issue. After some testing, it looks like this fix will work. I'll release a new version with this change included.

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.

None yet

3 participants