fix: Allow Ctrl+C to work while waiting on OAuth flow#7
Conversation
This `pkce.rs` was doing a wait for a callback in such a way where `SIGTERM` was not working (like when hitting `Ctrl+C`). Fix.
a4bfcb6 to
4070fd0
Compare
The async rewrite of wait_for_callback changed accept-error handling from fail-fast (propagate the error) to retry-on-continue. With no delay, a persistent accept() failure such as file-descriptor exhaustion turns the loop into a tight CPU spin that runs until the 120s timeout fires. Sleep 50ms before retrying. The sleep is an await point, so it keeps the original PR's Ctrl+C cancellation behavior intact while bounding the retry rate.
|
Pushed a small follow-up commit (876a0fe) on top of this branch. Why: The async rewrite here is correct and fixes the Ctrl+C hang. In the same lines, the accept-error path also changed from fail-fast to retry-on- let (mut stream, _) = match listener.accept().await {
Ok(conn) => conn,
Err(_) => continue,
};Retrying is the right call for transient, per-connection errors (e.g. What changed: a 50ms backoff before retrying. Err(_) => {
tokio::time::sleep(Duration::from_millis(50)).await;
continue;
}This bounds the retry rate while still recovering if the condition clears. Verification: full suite green on the amended branch — |
|
Additional change from @jgowdy-godaddy looks good to me as well. |
🤖 I have created a release *beep* *boop* --- ## [0.1.2](cli-engine-v0.1.1...cli-engine-v0.1.2) (2026-06-01) ### Features * Allow hard-coded redirect URL ([#9](#9)) ([e24dc24](e24dc24)) * Fix keychain issues and add fs fallback ([#10](#10)) ([853a98a](853a98a)) ### Bug Fixes * Allow Ctrl+C to work while waiting on OAuth flow ([#7](#7)) ([2b6d10e](2b6d10e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This
pkce.rswas doing a wait for a callback in such a way whereSIGTERMwas not working (like when hittingCtrl+C). Fix.