stevedlawrence opened a new pull request, #802: URL: https://github.com/apache/daffodil/pull/802
Our Enum implementation use for property values/lookups has important benefits over Scala Enumerations. However, it seems like the way we implement it can lead to circular deadlocks. When a Value is initialized it causes the Enum to be initialized. And the Enum initialized calls forceConstruction to initialized all the Values. This leads to circular instantiating that works in most cases, but sometimes leads to a deadlock. Where this deadlock exists or how to fix it is not clear. It's also not clear what changed to make this deadlock much more likely. To avoid this, we this change removes the forceConstruction function and replaces it with a manually managed Array of Enum Values. This Array is lazily evaluated so that instantiated an Enum does not also directly instantiate the Enum Value, avoiding the circular deadlock. This does require extra code to define an Enum, but the majority of Enums are in generated code so doesn't add much maintenance burden. DAFFODIL-2704 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
