Skip to content

Rector appears to be caching files before they've finished processing. #7770

@aboyton

Description

@aboyton

Bug Report

Subject Details
Rector version 0.15.13

When running Rector for some reason I have a file that is failing to process, with an error very similar to #7586. If there are files which work they pass and then Rector hangs when it gets to the problematic file. If I just try process the problematic file then I get no output whatsoever.

This issue though isn't about that bug, this issue is about incorrect caching of files when Rector hangs.

When Rector does hang, if I quit rector with Ctrl + C and then run again it appears as those the file that was problematic has been marked as processed and so running Rector succeeds the second time.

If I run with vendor/bin/rector process --clear-cache then I get stuck on the problematic file again, or if I change the list of files to process (which appears to reset the cache) it fails the first run and succeeds the second.

Minimal PHP Code Causing Issue

Unfortunately I don't have that as the code that is breaking things appears to work on https://getrector.org/demo/ :(

I've set $rectorConfig->parallel(seconds: 600, maxNumberOfProcess: 1); to make things easier to debug, but the issue occurs with parallel processes as well.

Expected Behaviour

When a file is processed it should only be added to the cache when it has successfully finished processing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions