nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
868 stars 265 forks source link

[BUG] GUID generation not very random #6158

Open thorst opened 2 months ago

thorst commented 2 months ago

Describe the bug There is a propensity for mirth to choose the same GUIDs when creating different code templates on different servers. I imagine the seed isn't very random or something when trying to generate the GUID. This isn't TOO much of an issue when exporting and importing code templates because when you can select to ignore the warnings, and then it'll generate new GUIDs for you. However, it becomes problematic when I'm trying to sync templates and libraries across servers. The GUID is the unique ID, but with it being so easy to overlap, it makes this auditing and syncing of servers impossible. With the chances of GUID collision insanely low (one in 2¹²²) this should not be happening if it's truly random.

To Reproduce On two separate servers, create 50 code templates on both servers. Now export from one server and try to import to the other server. There will be some GUIDs that overlap.

Expected behavior I would expect there to be 0 overlapping GUIDs in such a small sample size.

Actual behavior There are GUIDs that exist in this set of 50 on both servers, but would be associated with separate templates.

Environment (please complete the following information):

Workaround(s) None

Additional context None

ab-mg-23 commented 2 months ago

Mirth is just making calls to java.util.UUID when generating the UUIDs, so this is less a Mirth issue and somewhere between the Java Runtime and the RHEL Kernel. Can you reproduce using a non-Redhat JDK like Azul Zulu or Amazon Corretto on your servers or even on a non-RHEL OS?

pacmano1 commented 2 months ago

Is that how code tempalte export/imports work? It persists the UID on export/import. Or are you saying 50 new code templates created independently on each server might overlap their UIDs?

thorst commented 2 months ago

Is that how code tempalte export/imports work? It persists the UID on export/import. Or are you saying 50 new code templates created independently on each server might overlap their UIDs?

Create new independent on each server. Then when you import it will TRY to maintain the guid, and if you choose to ignore the arning itll assign a new guid on your behalf.

thorst commented 2 months ago

Mirth is just making calls to java.util.UUID when generating the UUIDs, so this is less a Mirth issue and somewhere between the Java Runtime and the RHEL Kernel. Can you reproduce using a non-Redhat JDK like Azul Zulu or Amazon Corretto on your servers or even on a non-RHEL OS?

Interesting, Ill ask our server team if we can try a different java distribution..