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

  1. use ruby-2.7
  2. Make a small change that affects all pages, like adding a single character to the layout
  3. nanoc compile
  4. Clear the cache to force a recompile rm -rf tmp
  5. 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)

Most upvoted comments

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.