phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

Determine available CPUs on Kubernetes

Open Wirone opened this issue 3 years ago • 5 comments

Fixes phpstan/phpstan#7479

Wirone avatar Jun 15 '22 10:06 Wirone

@ondrejmirtes why I get

Method PHPStan\Process\CpuCoreCounter::getNumberOfCpuCores() throws checked exception DivisionByZeroError but it's missing from the PHPDoc @throws tag.

when playground does not return any error for this code? 🤔

Wirone avatar Jun 15 '22 10:06 Wirone

@Wirone Because this is reported only as part of some optional rules: https://phpstan.org/blog/bring-your-exceptions-under-control

ondrejmirtes avatar Jun 15 '22 11:06 ondrejmirtes

I set this exception to be unchecked and rebased the branch. There are some memory limit errors which is weird, I need to look into it.

ondrejmirtes avatar Jun 15 '22 11:06 ondrejmirtes

@ondrejmirtes do you have any idea what's wrong with the memory limits? 🤔 I think it's not caused by my changes, so how we can fix that and finish this PR?

Wirone avatar Aug 16 '22 14:08 Wirone

My wild guess is that GitHub Actions also runs on Kubernetes. We'd have to debug the number of cores used before and after your changes to see if it can be the reason for exhausting memory limit.

ondrejmirtes avatar Aug 16 '22 15:08 ondrejmirtes

Hi, I'm cleaning up old and stale PRs. Please send a new PR if you're still interested, thanks.

ondrejmirtes avatar Oct 16 '22 10:10 ondrejmirtes