nHapiNET / nHapi

nHapi is the .Net port of the original Java project HAPI.
Mozilla Public License 2.0
272 stars 155 forks source link

nHapi returns error for valid HL7 files while doing validation concurrently #393

Closed v-nmadwani closed 1 year ago

v-nmadwani commented 1 year ago

Discussed in https://github.com/nHapiNET/nHapi/discussions/392

Originally posted by **v-nmadwani** December 8, 2022 We are using nHapi to validate batch of 1000 HL7 files (want to use it for much more files). We are using Parallel.ForEachAsync loop with degree of parallelism set to 250. For some of the valid HL7 files we receive errors as below: 1. An item with the same key has already been added. Key: ^~\& 2. Index was outside the bounds of the array.Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array 3. Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct. Please suggest on this, we are kind of blocked on this. Thanks
milkshakeuk commented 1 year ago

Hi @v-nmadwani could you please provide more details, such as version of nhapi version of dotnet etc etc more logs.

v-nmadwani commented 1 year ago

Hi @milkshakeuk We are using nhapi version 2.0.3 and .net 6.0

milkshakeuk commented 1 year ago

@v-nmadwani nhapi 2.0.3 is very old and doesn't support net6.0 are you sure this is the version? Could you perhaps provide a sample test project so it can be replicated?

milkshakeuk commented 1 year ago

@v-nmadwani any update on this?

milkshakeuk commented 1 year ago

@v-nmadwani if you are not able to provide more information / samples etc then I will have to close this issue.

milkshakeuk commented 1 year ago

@v-nmadwani I'm closing this ticket for now, if you feel it's still an issue please re-open with the additional information.