concurrency_issue #630

Merged
merged 3 commits into from May 1, 2017

Conversation

Projects
None yet
3 participants
@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 some commits Apr 21, 2017

Jeppe Langhoff Sørensen
[(concurrency_issue)] Fixed concurrency issues in BaseRuntimeElementC…
…ompositeDefinition

Removed exceptions used in control flow in ParserState
Test showing further concurrency issues in FhirContext (committed as ignored).
Jeppe Langhoff Sørensen
[(concurrency_issue)] Fixed concurrency issues in BaseRuntimeElementC…
…ompositeDefinition

Removed exceptions used in control flow in ParserState
Test showing further concurrency issues in FhirContext (committed as ignored).
Jeppe Langhoff Sørensen
@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Apr 22, 2017

Coverage Status

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

Coverage Status

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

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Apr 22, 2017

Owner

This is super cool! Will merge this weekend.

Owner

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

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