Skip to content

SSG prematurely failing due to changes in spatie/fork package #155

Description

@globalexport

Is this really guaranteed to wait for all closures to finish?

 $results = $this->tasks->run(...$closures);

[EDIT] Please see: #155 (comment)

I am in the process of upgrading Statamic v3 to v4. For that reason, I am not 100% sure if the adjusted SSG setup I created in the past is responsible for a possible race condition.
That's why I am testing both, the original SSG command and my custom one.

The original command gives me:
Bildschirmfoto 2023-11-30 um 18 08 07

For the sake of simplicity, I am using the new shouldRejectPage() method to only allow a small portion of 10 blog pages` urls to be generated on 1 or 2 workers.

Using 1 worker always succeeds. Using 2 or more workers rarely succeeds (by chance).

In my own code I am logging everything (method entering, exceptions, etc..), but there is nothing indicating errors during the html generation.

What caught my eye in particular was that the process is interrupted directly after one worker returned from its closure method. There is no NotGeneratedException of any worker. It looks like other workers do not get the time to complete their task and return their arrays.

return compact('count', 'warnings', 'errors');

Therefore, worker data is missing and the process ends up in anyTasksFailed without any useful information.

if ($this->anyTasksFailed($results)) {      
  throw GenerationFailedException::withConsoleMessage("\x1B[1A\x1B[2K");
}

I am thankful for any ideas.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions