# repl: Retry iopub connection on failure \(\#62358\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/be52d3b757cf7f1113e3e4b9766a87eed9cb6a8a)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: be52d3b757cf7f1113e3e4b9766a87eed9cb6a8a

Requested commit: be52d3b757cf7f1113e3e4b9766a87eed9cb6a8a

Commit: be52d3b757cf7f1113e3e4b9766a87eed9cb6a8a

Tree: 111b5eb237ef9ee482e32d098c4bbe063de5224c

Author: Yxxx

Committer: GitHub

## Message

```
repl: Retry iopub connection on failure (#62358)

## Context

This is a rebase of #52302, which was approved by @Veykril in May but
still needed a rebase before it could be merged — it seems the original
author @MostlyKIGuess forgot about it. I rely on this fix daily for REPL
over SSH on an unstable connection and need it rather urgently, so I
cherry-picked the original commit (with authorship preserved) and
resubmitted it as a new PR.

Closes #51834
Supersedes #52302

## How to Review

The code itself was already reviewed and approved in #52302. This PR
only rebases it onto latest `main`, with one simple conflict resolution
against #53014: when all retries are exhausted, the error now uses the
improved message from that PR (suggesting `pip install ipykernel` on the
remote host) instead of the plain one. Comparing this diff against the
original PR's diff should make the review straightforward.

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- repl: Fixed iopub connection failures over SSH on slow or unstable
connections by retrying with exponential backoff.

Co-authored-by: mostlykiguess <bruvistrue93@gmail.com>
```

## Parents

- [803467f37f8f2537307406a4d40e97a20f47cd39](https://git.cafe/gitcafe/zed/commit/803467f37f8f2537307406a4d40e97a20f47cd39?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/be52d3b757cf7f1113e3e4b9766a87eed9cb6a8a?format=markdown)
