Description
Previous ID | SR-6555 |
Radar | None |
Original Reporter | graemer957 (JIRA User) |
Type | Bug |
Attachment: Download
Environment
Swift version 4.0 (swift-4.0-RELEASE)
Swift version 4.0.2 (swift-4.0.2-RELEASE)
Swift version 4.0.3 (swift-4.0.3-RELEASE)
Swift version 4.1 (swift-4.1-RELEASE)
Swift version 4.1.1 (swift-4.1.1-RELEASE)
Swift version 4.1.2 (swift-4.1.2-RELEASE)
Swift version 4.2-dev (LLVM 70f121e1f0, Clang 4c555650a6, Swift bb9532c588)
Additional Detail from JIRA
Votes | 1 |
Component/s | Foundation |
Labels | Bug |
Assignee | @pushkarnk |
Priority | Medium |
md5: 0ccd93cd881b11aece0f0343f75c7fb7
Issue Description:
Steps to reproduce
Using the attached project with Swift 4.0.3 under Ubuntu 14.04.5 LTS:
- Leave
top
running in one session - In a new session
swift build
swift run
- Observe after first HTTP response CPU time drops back to zero
- However, after second HTTP response CPU is using constant time
Expected behaviour
CPU time is not constantly used.
Workaround
Recreate URLSession for each dataTask(with: )
, by commenting out line 4 and uncommenting line 7.
Swift versions affected
-
Swift version 4.0 (swift-4.0-RELEASE)
-
Swift version 4.0.2 (swift-4.0.2-RELEASE)
-
Swift version 4.0.3 (swift-4.0.3-RELEASE)
-
Swift version 4.1 (swift-4.1-RELEASE)
-
Swift version 4.1.1 (swift-4.1.1-RELEASE)
-
Swift version 4.1.2 (swift-4.1.2-RELEASE)
-
Swift version 4.2-dev (LLVM 70f121e1f0, Clang 4c555650a6, Swift bb9532c588)
Swift versions unaffected
- Swift version 3.1.1 (swift-3.1.1-RELEASE)
Misc
-
Target is x86_64-unknown-linux-gnu
-
Have tried Ubuntu 16.04, but it exhibits the same behaviour
-
If the attachment is unavailable, it can be found on GitLab