ezpublish-legacy
ezpublish-legacy copied to clipboard
Fix EZP-23092: incorrect error message when fetching from DFS
JIRA: https://jira.ez.no/browse/EZP-23092
If there is a mismatch between metadata size and dfs size, the error message generated by dfs fetch will be incoherent:
'Size (100) of written data for file 'var/.../....cache123456tmp.php' does not match expected size 100'
This fixes the message's second argument to the actual variable being checked, but also adds an additional validation of the metadata vs dfsfile size at each loop iteration.
I think this is (partly) a duplicate of PR #808, which also tackles the problem that temporary files might remain on the filesystem when the sizes don't match.
@jeromegamez: Hi! It seems to me this tackles a different issue, though the code does intersect a bit (so probably one of the PRs may need to be updated if/when the other is merged)
Updated:
- A 'kernel-clustering' debug message is displayed within the loop, as opposed to error,
- Re-fetch metadata
- clearstatcache on dfs file before retrieving the filesize