Skip to content

Workaround SR-13822 by keeping the file handle alive for the connection #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2020

Conversation

benlangmuir
Copy link
Contributor

On Linux, the file handle is closing the file descriptor on deinit
despite closeOnDealloc: false
(https://bugs.swift.org/browse/SR-13822). Workaround by keping the
FileHandle alive.

rdar://70995458

On Linux, the file handle is closing the file descriptor on deinit
despite `closeOnDealloc: false`
(https://bugs.swift.org/browse/SR-13822). Workaround by keping the
FileHandle alive.

rdar://70995458
@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@benlangmuir
Copy link
Contributor Author

@compnerd FYI we saw failures in a sourcekit-lsp integration test on Linux (and the same issue would presumably affect Windows) after #341:
https://ci.swift.org/view/Packages/job/oss-swift-package-linux-ubuntu-16_04/5584/console

05:03:21 ==== OUTPUT ====
05:03:21 2020-11-03 07:03:19.543 sourcekit-lsp[15876:ee7fc700] IO error 9
05:03:21 2020-11-03 07:03:19.554 sourcekit-lsp[15876:ee7fc700] IO error sending message 9
05:03:21 2020-11-03 07:03:19.891 sourcekit-lsp[15876:ee7fc700] IO error sending message 9
05:03:21 2020-11-03 07:03:19.894 sourcekit-lsp[15876:ee7fc700] IO error sending message 9

The problem seems to be that corelibs-foundation FileHandle is always closing the file, even with closeOnDealloc: false. I filed https://bugs.swift.org/browse/SR-13822 and the current PR should work around the issue.

@compnerd
Copy link
Member

compnerd commented Nov 3, 2020

@benlangmuir thanks for the heads up! Sorry about this :-(

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.

2 participants