这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@fkorotkov
Copy link
Contributor

By manually handling waitUntilExit

Tested by using /bin/sleep 120 instead of /usr/sbin/arp -an.

By manually handling `waitUntilExit`

Tested by using `/bin/sleep 120` instead of `/usr/sbin/arp -an`.
@fkorotkov fkorotkov requested a review from edigaryev as a code owner October 1, 2024 14:56
@fkorotkov fkorotkov enabled auto-merge (squash) October 1, 2024 14:56
process.waitUntilExit()
while process.isRunning {
if Task.isCancelled {
process.terminate()
Copy link
Collaborator

@edigaryev edigaryev Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this line won't be called 99.99% of the time, because Task.sleep() runs long enough and will throw a CancellationError on task cancellation, thus immediately exiting the loop.

Having a proper async Process() can be burdensome in Swift at the moment, and we have Process() in other places too, so what do you think about addressing the root cause instead? See #916.

@fkorotkov fkorotkov closed this Oct 2, 2024
auto-merge was automatically disabled October 2, 2024 13:48

Pull request was closed

@fkorotkov fkorotkov deleted the arp-respect-cancelation branch May 28, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants