Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result cache seems to kill Elasticsearch #3459

Closed
shadowhand opened this issue Jun 11, 2020 · 5 comments
Closed

Result cache seems to kill Elasticsearch #3459

shadowhand opened this issue Jun 11, 2020 · 5 comments

Comments

@shadowhand
Copy link

Support question

This really makes no sense to me, but here it is...

I've been attempting to get phpstan upgraded to v0.12 for a couple of days. Everything worked fine locally but when running vendor/bin/phpstan analyse --memory-limit=512M on CircleCI, our elasticsearch container would be killed with the following error:

Exited with code 137
CircleCI received exit code 137

And then because elasticsearch is dead, our integration tests fail and the build fails.

Nothing else in our environment changed that should result in ES being terminated this way. The only change is upgrading phpstan and phpstan extensions. I attempted to upgrade ES to a newer version, hoping that it was some kind of version specific problem, but got the same result. While trying to figure out exactly which analysis was killing ES, I added --debug to the phpstan command and suddenly the builds started working. 😕

The only thing I can guess is happening here is that somehow phpstan's result cache is flooding the filesystem and/or memory in a way that causes elasticsearch to terminate. The whole situation is incredibly confusing to me.

@ondrejmirtes
Copy link
Member

Hi, I don't think it can be because of result cache as that's just a file on disk. I'd suspect parallel running more. Can you tune some of the settings (https://phpstan.org/config-reference#parallel-processing) to see if it's really the cause?

@shadowhand
Copy link
Author

shadowhand commented Jun 13, 2020

@ondrejmirtes does --debug disable parallel processing?

Edit: I see that the documentation states that it does. I will try running with maximumNumberOfProcesses: 1 and see if that solves it.

@shadowhand
Copy link
Author

@ondrejmirtes using a single process solved the issue. It also made phpstan about 4x slower, but such is life.

@ondrejmirtes
Copy link
Member

You can try to use a smaller number of threads, or get a bigger server :)

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants