Affects Version/s: 9.10, 10.10
Requesting a stored rendition while it is currently being built causes Nuxeo to use the rendition in the transient store that was generated from a prior rendition request - and store it as the current rendition, while simultaneously generating the new rendition into the transient store - but failing to deliver or store the new rendition. The result is that delivered renditions are perpetually one iteration behind.
Reproduction steps on Nuxeo 9.10-HF30 with only JSF UI installed:
1. Add test-lazy-rendition-contribution to the "custom" template without rendition definitions "iamlazy", "lazyAutomation" and "lazyDelayedErrorAutomationRendition".
2. Add "custom" to templates in nuxeo.conf
3. Create workspace1
4. Create folder1 in workspace1
5. Upload ten files into folder1, each of which has a Main File size of approximately 50MB. The objective is to make the folder size sufficiently large to cause the zipTreeExportLazily rendition to take several seconds to generate (will vary, of course, based on test server configuration)
6. Generate a zipTreeExportLazily stored rendition by executing the following script
7. Verify the downloaded "export.zip" file matches the folder contents
8. Add a new file to folder1 by incrementing i each time starting with 11
9. Increment folder1 property dc:issued value (propertyValue=<previous value + 1> below starting with 1340000000001) so its rendition will be re-generated on next request
10. Re-execute step #6
11. Inspect the downloaded "export.zip" file and observe that the file added in step 8 is absent
12. Repeat steps 8-11 and observe each time that the downloaded zip is one folder revision behind
I believe the problem is caused by the fact that a Lazy Rendition that is both marked "Completed" and has a source change should be reset to "Not Completed" right before a Work to regenerate the rendition is scheduled. See lines https://github.com/nuxeo/nuxeo/blob/bb1b6344ac3c5be08eea557e618fd8f0808650ff/nuxeo-features/nuxeo-platform-rendition/nuxeo-platform-rendition-core/src/main/java/org/nuxeo/ecm/platform/rendition/lazy/AbstractLazyCachableRenditionProvider.java#L224 and https://github.com/nuxeo/nuxeo/blob/bb1b6344ac3c5be08eea557e618fd8f0808650ff/nuxeo-features/nuxeo-platform-rendition/nuxeo-platform-rendition-core/src/main/java/org/nuxeo/ecm/platform/rendition/lazy/AbstractLazyCachableRenditionProvider.java#L251.