stevedlawrence opened a new pull request #641: URL: https://github.com/apache/daffodil/pull/641
When saving a parser, write a NUL-terminated ASCII string of the form `DAFFODIL <VERSION>` directly to the output stream prior to DataProcessor serialization. A benefit to writing directly to the head of the OutputStream is that this avoids the gzip compression and Java serialization in the header, making it simple to read and validate for compatibility. This also allows a user to run `head -1z` on a saved parser to quickly determine what version of Daffodil a saved parser is compatible with. When reloading a saved parser, we check that the file starts with the string `DAFFODIL `, and the following data up to a NUL-terminator matches the current version of Daffodil. If they are the same, we assume we are reloading with the same version of Daffodil used to save the parser, and so they should be compatible. However, we can't really control if a user swaps out incompatible dependencies between save/reload, and we also don't really know which versions of libraries are compatible. So this also improves detection and diagnostics when a reload error occurs that most likely due to dependency incompatibility. So if there are reload errors, it should make the cause and resolution more clear. DAFFODIL-2266 -- 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]
