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

feat(daemon): Remove named_pipe in favor of tokio #1710

Merged
merged 16 commits into from
May 8, 2023
Merged

Conversation

traeok
Copy link
Member

@traeok traeok commented May 3, 2023

The named_pipe library is no longer maintained, and the recommendation from the library's author is to use tokio's implementation of named pipes instead.

This PR replaces the named_pipe library with tokio, and also uses tokio::net::UnixStream instead of the standard library's UnixStream so that logic is consistent across all platforms for the communication functions.

It also updates the daemon logic so that the Rust client looks for the Node.js server process before trying to connect to the socket/pipe. This prevents race conditions where the server process was started by the daemon, but the Rust client tried to attach to the pipe before it was initialized by the server.

@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (d08d075) 92.74% compared to head (bdb7c5e) 92.74%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1710   +/-   ##
=======================================
  Coverage   92.74%   92.74%           
=======================================
  Files         416      416           
  Lines        6916     6916           
  Branches     1221     1221           
=======================================
  Hits         6414     6414           
  Misses        501      501           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@traeok traeok marked this pull request as ready for review May 3, 2023 15:50
Copy link
Member

@awharn awharn left a comment

Choose a reason for hiding this comment

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

Just one question

zowex/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

Thanks for migrating to tokio for technical currency 👍 Left a few questions 🙂

zowex/src/comm.rs Outdated Show resolved Hide resolved
zowex/src/comm.rs Outdated Show resolved Hide resolved
zowex/Cargo.toml Show resolved Hide resolved
Copy link
Member

@gejohnston gejohnston left a comment

Choose a reason for hiding this comment

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

I agree with Timothy's comment that it will be useful to confirm whether there is any performance impact related to connecting first or checking for daemon first.

I also had one question about confirming the behavior during shutdown of the communication stream.

Perhaps neither question will require any change. Everything else looks good to me.

zowex/src/comm.rs Show resolved Hide resolved
traeok added 2 commits May 8, 2023 10:29
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
@traeok traeok linked an issue May 8, 2023 that may be closed by this pull request
@sonarcloud
Copy link

sonarcloud bot commented May 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@traeok traeok merged commit b6411f2 into master May 8, 2023
@traeok traeok added the release-minor Indicates a minor feature has been added label May 8, 2023
@zFernand0 zFernand0 deleted the feat/use-tokio branch May 8, 2023 16:07
@github-actions
Copy link

github-actions bot commented May 8, 2023

Release succeeded for the master branch. 🎉

The following packages have been published:

Powered by Octorelease 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-minor Indicates a minor feature has been added released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite daemon implementation for Windows to stop using named_pipe
5 participants