nanoc: Small chance to compile wrong page with ruby 2.7
Under Ruby 2.7 there is a very small chance that nanoc compile will use the wrong content for a page when a large number of pages change at the same time
Steps to reproduce
- use ruby-2.7
- Make a small change that affects all pages, like adding a single character to the layout
nanoc compile
- Clear the cache to force a recompile
rm -rf tmp
nanoc compile --diff
Expected behavior
The second compile should show no changes.
Actual behavior
About 2 to 4 of every 1000 pages changes, to the correct version. Subsequent nanoc compile
commands show no changes.
Details
It seems to work OK on ruby 2.6 and it also works fine on smaller repos and smaller changes. Only during a compile that affects 1000 pages does the compilation get confused.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 15 (14 by maintainers)
This is now fixed in the just-released 4.11.19. (It might take a few minutes before that release becomes available for installing.)
I believe I have found the culprit: a non-threadsafe object used across threads. A fix is in #1510.
More proof that concurrency is not for the faint of heart.