You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`ProcessInfo.processInfo.activeProcessorCount` supports cpusets (https://bugs.swift.org/browse/SR-10611) but ignores CFS quotas. CFS quota is the most common use case since it's the feature used when starting docker containers with the `--cpus` option and the default behavior in Kubernetes (cpusets usage is an option to enable on the admin side in the kubelet configuration so unreachable for common users).
This may lead to Swift code (including Swift Package Manager, and thus the building of Swift code) being terminated unexpectedly because it's trying to parallelize too aggressively.
Steps to reproduce:
```
$ docker run -it --rm --privileged --cpus=2 swift:5.2 swift
Welcome to Swift version 5.2.3 (swift-5.2.3-RELEASE).
Type :help for assistance.
1> import Foundation; ProcessInfo.processInfo.activeProcessorCount
$R0: Int = 4
```
Additional Detail from JIRA
md5: 7a02398558abf3211afb071c5406cdbb
Issue Description:
`ProcessInfo.processInfo.activeProcessorCount` supports cpusets (https://bugs.swift.org/browse/SR-10611) but ignores CFS quotas. CFS quota is the most common use case since it's the feature used when starting docker containers with the `--cpus` option and the default behavior in Kubernetes (cpusets usage is an option to enable on the admin side in the kubelet configuration so unreachable for common users).
This may lead to Swift code (including Swift Package Manager, and thus the building of Swift code) being terminated unexpectedly because it's trying to parallelize too aggressively.
Steps to reproduce:
```
$ docker run -it --rm --privileged --cpus=2 swift:5.2 swift
Welcome to Swift version 5.2.3 (swift-5.2.3-RELEASE).
Type :help for assistance.
1> import Foundation; ProcessInfo.processInfo.activeProcessorCount
$R0: Int = 4
```
For reference, we implemented that feature in SwiftNIO at apple/swift-nio#1518
The text was updated successfully, but these errors were encountered: