statamic / ssg

The official Statamic Static Site Generator
229 stars 23 forks source link

Concurrency protection for file writing necessary? #117

Closed globalexport closed 1 year ago

globalexport commented 1 year ago

Is there a protection against concurrent file writing on paginated pages (e.g., blog entry overviews) when using multiple worker threads?

It may otherwise be possible to run into issues (missing entries) when trying to write into the same index.html file at the same time. I have a suspicion that this might have happened to me recently.

jasonvarga commented 1 year ago

Each thread gets a predefined list of urls to generate. There should be no collisions.

globalexport commented 1 year ago

You are right @jasonvarga. The paginated page is visited by one worker in one thread.

Nevertheless, there seems to be another limitation or bug somewhere which can result in an incomplete process when choosing a higher worker count. It is hard to find because there were no logged errors.