+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_cli): prevent the socket transport from printing an error on shutdown #3417

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Oct 13, 2022

Summary

Fixes #3414

This PR adds special handling for the rome/shutdown command in the SocketTransport to make it gracefully handle the connection being immediately terminated by the server on reception of the shutdown request.

Test Plan

Unfortunately this area of the CLI is hard to test since the tests would need to actually start and stop a daemon instance on the host system. Additionally in this case since the read and write tasks write their error directly to stderr (since they cannot share access to the Console object) it wouldn't be possible for the tests to ensure that nothing was printed to the output.
Instead I simply ran the rome start and rome stop commands in sequence to ensure it never printed an error message (I ran this a few times to make sure it couldn't be triggered randomly due to concurrency)

@leops leops temporarily deployed to netlify-playground October 13, 2022 08:57 Inactive
@netlify
Copy link

netlify bot commented Oct 13, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit a71bef0
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/6347d304cbd7b40008e67088

@github-actions
Copy link

@MichaReiser MichaReiser added the A-CLI Area: CLI label Oct 13, 2022
@leops leops merged commit c01895e into main Oct 13, 2022
@leops leops deleted the fix/daemon-stop-output branch October 13, 2022 12:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 rome stop: Connection unexpectedly closed
3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载