# cloud_api_client: Add yield point to prevent background task hangs \(\#63105\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 770aac345c76d9fcf82c01ba0dea08e5739b27b1

Requested commit: 770aac345c76d9fcf82c01ba0dea08e5739b27b1

Commit: 770aac345c76d9fcf82c01ba0dea08e5739b27b1

Tree: 6eec448c7ecd9467cbe003d437288115950becf8

Author: Remco Smits

Committer: GitHub

## Message

````
cloud_api_client: Add yield point to prevent background task hangs (#63105)

Follow-up: https://github.com/zed-industries/zed/pull/62874

# Objective

After having Zed open for a while I'm getting some foreground and
background hang warnings, like this one.

```
2026-08-19T11:25:45+02:00 INFO [zed::reliability::hang_detection::logging] New foreground hang detected: Tasks(s) that ran too long 215.24375ms          - crates/cloud_api_client/src/websocket/native.rs:34:23
```

## Solution

My solution is to add yield points so a single task doesn't block the
executor thread for too long.

## 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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
````

## Parents

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

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