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.activeProcessorCount (via __CFActiveProcessorCount(0)) uses sysconf(_SC_NPROCESSORS_ONLN). This result is undesirably high when in a managed environment, like a Docker container: it returns the online CPU count of the system as a whole, which may not respect quotas put in place by an administrator using cgroups. 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.
Expected Results:
The active processor count reflects a value appropriate for the execution context.
Actual Results: swift build intermittently gets killed by the system when running under some CI platforms.
Environment
Linux 5e26e3cddd2b 4.15.0-1035-aws #37-Ubuntu SMP Mon Mar 18 16:15:14 UTC 2019 x86_64 Linux
Docker: 18.09.1
Swift: 5.0.1
Additional Detail from JIRA
md5: 4f042c19156dc727b189f6d17bffe19f
Issue Description:
ProcessInfo.activeProcessorCount (via __CFActiveProcessorCount(0)) uses sysconf(_SC_NPROCESSORS_ONLN). This result is undesirably high when in a managed environment, like a Docker container: it returns the online CPU count of the system as a whole, which may not respect quotas put in place by an administrator using cgroups. 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.
Expected Results:
The active processor count reflects a value appropriate for the execution context.
Actual Results:
swift build intermittently gets killed by the system when running under some CI platforms.
Prior art:
Mono: https://bugzilla.xamarin.com/show_bug.cgi?id=39279
.NET CLR: https://github.com/dotnet/coreclr/issues/10690
Java: https://bugs.openjdk.java.net/browse/JDK-8146115
The text was updated successfully, but these errors were encountered: