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

concurrency_issue #630

Merged
merged 3 commits into from May 1, 2017
Merged

concurrency_issue #630

merged 3 commits into from May 1, 2017

Conversation

@Jaypeg85
Copy link

@Jaypeg85 Jaypeg85 commented Apr 21, 2017

Fixed some concurrency issues in FhirContext (also fixed with #610, but i added volatile to the control members myInitializing and myInitialized to be in sync with the maps)
Created test showcasing more concurrency issues in FhirContext, also shows the #610 issue.
Removed exceptions used in control flow of ParserState

I've seen more concurrency issues in FhirContext, that I couldn't reproduce in a unit test, however they are very consistent on the Android environment.
Stacktrace:
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at ca.uhn.fhir.util.FhirTerser.visit(FhirTerser.java:512)
at ca.uhn.fhir.util.FhirTerser.getAllPopulatedChildElementsOfType(FhirTerser.java:131)
at ca.uhn.fhir.parser.BaseParser.containResourcesForEncoding(BaseParser.java:237)
at ca.uhn.fhir.parser.BaseParser.containResourcesForEncoding(BaseParser.java:271)
at ca.uhn.fhir.parser.JsonParser.encodeResourceToJsonStreamWriter(JsonParser.java:821)
at ca.uhn.fhir.parser.JsonParser.encodeResourceToJsonStreamWriter(JsonParser.java:816)
at ca.uhn.fhir.parser.JsonParser.doEncodeResourceToJsonLikeWriter(JsonParser.java:203)
at ca.uhn.fhir.parser.JsonParser.doEncodeResourceToWriter(JsonParser.java:193)
at ca.uhn.fhir.parser.BaseParser.encodeResourceToWriter(BaseParser.java:402)
at ca.uhn.fhir.parser.BaseParser.encodeResourceToString(BaseParser.java:385)
at ca.uhn.fhir.parser.ParserState$PreResourceState.postProcess(ParserState.java:2075)
at ca.uhn.fhir.parser.ParserState$PreResourceState.wereBack(ParserState.java:2175)
at ca.uhn.fhir.parser.ParserState$ContainedResourcesStateHapi.wereBack(ParserState.java:1360)
at ca.uhn.fhir.parser.ParserState.pop(ParserState.java:122)
at ca.uhn.fhir.parser.ParserState.access$100(ParserState.java:52)
at ca.uhn.fhir.parser.ParserState$ElementCompositeState.endingElement(ParserState.java:1549)
at ca.uhn.fhir.parser.ParserState.endingElement(ParserState.java:94)
at ca.uhn.fhir.parser.JsonParser.parseChildren(JsonParser.java:1377)
at ca.uhn.fhir.parser.JsonParser.parseChildren(JsonParser.java:1356)
at ca.uhn.fhir.parser.JsonParser.parseChildren(JsonParser.java:1292)
at ca.uhn.fhir.parser.JsonParser.doParseResource(JsonParser.java:230)
at ca.uhn.fhir.parser.JsonParser.doParseResource(JsonParser.java:212)
at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:644)
at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:692)

Jeppe Langhoff Sørensen added 3 commits Apr 21, 2017
…ompositeDefinition

Removed exceptions used in control flow in ParserState
Test showing further concurrency issues in FhirContext (committed as ignored).
…ompositeDefinition

Removed exceptions used in control flow in ParserState
Test showing further concurrency issues in FhirContext (committed as ignored).
…y_issue' into concurrency_issue
@coveralls
Copy link

@coveralls coveralls commented Apr 22, 2017

Coverage Status

Coverage decreased (-0.1%) to 77.136% when pulling 1623281 on Jaypeg85:concurrency_issue into cbc652d on jamesagnew:master.

@jamesagnew
Copy link
Owner

@jamesagnew jamesagnew commented Apr 22, 2017

This is super cool! Will merge this weekend.

jamesagnew added a commit that referenced this pull request May 1, 2017
@jamesagnew jamesagnew merged commit 2a89ff8 into jamesagnew:master May 1, 2017
1 of 2 checks passed
1 of 2 checks passed
coverage/coveralls Coverage decreased (-0.1%) to 77.136%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.