-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Batch transaction produces multiple tags in the TAGDEF table, causing IDX_TAGDEF_TYPESYSCODE constraint exceptions #3156
Comments
Heya @seanmcilvenna , we are actively working on this now. Any chance you happen to have a PHI-redacted version of a bundle that causes this for you? Just to ensure we're working under identical conditions? Cheers |
Hi, also, if there's any chance you have additional details (more of the stack trace, etc), it could be helpful. Or if you have encountered it again lately. |
Hello, |
I appear to have encountered the same issue, but with multiple single-record POSTs rather than a bundle. here's a short script that inconsistently replicates the issue: #!/usr/bin/bash
TAG=tag$RANDOM
for i in {1..5}
do
FAMILYNAME=Smith$RANDOM
GIVENNAME=John$RANDOM
curl \
https://$SERVER/Patient \
-X POST \
--header "Content-Type: application/fhir+json" \
-w "got %{http_code} - %{time_pretransfer} sec to connect, %{time_starttransfer} sec to respond, %{time_total} sec total \n" \
-s \
--data "{
\"meta\": {
\"tag\" : [
{
\"system\" : \"http://mydomain/fhir/custom_tag/test/$TAG\",
\"code\" : \"a code\"
}
]
},
\"resourceType\": \"Patient\",
\"name\": [ {
\"family\": \"$FAMILYNAME\",
\"given\": [ \"$GIVENNAME\" ]
} ],
\"gender\": \"male\",
\"birthDate\": \"1974-12-25\"
}" \
--output ./result$i.txt &
done |
I'm seeing this on HAPI 6.4.0 talking to an Azure SQL database.
|
Describe the bug
Encountered a race condition, where when a transaction is being processed that has multiple resources with the same tag, occasionally, the tag gets created multiple times in the TAGDEF table. Then, HAPI fails because it expects that the tags in that table be unique.
Here's an example of the exception I'm getting:
To Reproduce
Expected behavior
A lack should be placed on the TAGDEF table when being modified during the batch transaction, or something, so that it does not produce the same tag multiple times in a single transaction.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: