Skip to content
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

fix: TTY being GC'd before command is ran #412

Merged
merged 2 commits into from
Mar 8, 2022
Merged

fix: TTY being GC'd before command is ran #412

merged 2 commits into from
Mar 8, 2022

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs self-assigned this Mar 8, 2022
@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #412 (c97328a) into main (d37df89) will increase coverage by 0.30%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #412      +/-   ##
==========================================
+ Coverage   68.23%   68.54%   +0.30%     
==========================================
  Files         158      155       -3     
  Lines        9225     9052     -173     
  Branches       73       73              
==========================================
- Hits         6295     6205      -90     
+ Misses       2307     2249      -58     
+ Partials      623      598      -25     
Flag Coverage Δ
unittest-go-macos-latest 62.81% <100.00%> (+0.18%) ⬆️
unittest-go-ubuntu-latest 67.60% <100.00%> (+0.19%) ⬆️
unittest-go-windows-2022 ?
unittest-js 66.02% <ø> (ø)
Impacted Files Coverage Δ
pty/start_other.go 75.86% <100.00%> (+7.68%) ⬆️
pty/ptytest/ptytest.go 94.44% <0.00%> (-5.56%) ⬇️
provisionerd/provisionerd.go 78.30% <0.00%> (-0.56%) ⬇️
pty/pty_windows.go
agent/usershell/usershell_windows.go
pty/start_windows.go
peer/conn.go 79.79% <0.00%> (+1.02%) ⬆️
coderd/provisionerdaemons.go 59.23% <0.00%> (+1.08%) ⬆️
database/pubsub.go 77.08% <0.00%> (+2.08%) ⬆️
peerbroker/dial.go 82.45% <0.00%> (+7.01%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d37df89...c97328a. Read the comment docs.

Comment on lines +34 to +36
// The GC can garbage collect the TTY FD before the command
// has finished running. See:
// https://github.com/creack/pty/issues/127#issuecomment-932764012
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice find 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a craaaazy race

@kylecarbs kylecarbs enabled auto-merge (squash) March 8, 2022 17:47
@kylecarbs kylecarbs merged commit 45daa44 into main Mar 8, 2022
@kylecarbs kylecarbs deleted the fixtty branch March 8, 2022 17:49
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.

None yet

2 participants