`cloudflare` feature: hrana streams are never closed
Maintainers usually reply within 11 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Read libsql/src/hrana/stream.rs and compare the RawStream Drop implementation’s feature gate with the cloudflare feature configuration. Confirm the behavior with default-features = false, features = ["cloudflare"] by checking whether dropping a stream sends a close request. Done when streams opened with that configuration are closed on drop.
Written by the indexing model from the issue text.
Description
Summary
With default-features = false, features = ["cloudflare"], the client never sends a close request for the hrana streams it opens. The Drop impl that sends it is compiled only with the remote feature.
Where
libsql/src/hrana/stream.rs. The code is identical in 0.9.30, 0.10.0 and current main:
#[cfg(feature = "remote")]
impl<T> Drop for RawStream<T>
where
T: HttpSend,
{
fn drop(&mut self) {
let baton = self.baton.get_mut().take();
if let Some(baton) = baton {
// ... sends StreamRequest::Close via self.client.oneshot(...)
}
}
}
With only cloudflare enabled, this impl does not exist, so dropping a RawStream sends nothing.
What we observed
Setup:
libsql0.9.30 (default-features = false, features = ["cloudflare"])worker0.6.7,wrangler dev4.105.0- local
sqld0.24.31 with default settings
We sent a few dozen sequential requests to the worker; each request runs several statements. Every query after that failed. sqld logged:
ERROR libsql_server::hrana::http: hrana server: Timed out while opening database connection
ERROR libsql_server::error: HTTP API: 429 Too Many Requests, DbCreateTimeout
The client got:
Hrana: `api error: `{"error":"Timed out while opening database connection"}``
After restarting sqld with --max-concurrent-connections 4096 --max-concurrent-requests 4096, the same requests (over 200 sequential ones) succeeded.
- Dominant language
- C
- Stars
- 17.3k
- Forks
- 557
- Avg merge
- 10d 15h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tursodatabase/libsql
-
bottomless: finished S3 upload tasks are never reaped, so sqld memory grows by ~10 KB per WAL batchPossibly taken @pavanmanishd claimed this 18 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
tursodatabase/libsql#2298 · 1 comment ·
Maintainers usually reply within 11 days
-
Rust local Row::get_value truncates embedded NUL TEXT and panics on malformed UTF-8 (0.9.30)Possibly taken @Sanjays2402 claimed this 29 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tursodatabase/libsql#2285 ·
Maintainers usually reply within 11 days
-
libsql-ffi: broken builds under Nix on macOSPossibly taken @frectonz claimed this 79 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
tursodatabase/libsql#2275 ·
Maintainers usually reply within 11 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tursodatabase/libsql#2226 ·
Maintainers usually reply within 11 days
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
tursodatabase/libsql#1925 ·
Maintainers usually reply within 11 days
All issues in tursodatabase/libsql
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
follow-up Prio 📌
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area: test kind: bug preview-effort: small priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
[BUG] MXF: update_tid_lut() writes past tracks[32] onto nb_tracks, turning a file-supplied track id into the write offsetPossibly taken @pranayr710 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
CCExtractor/ccextractor#2457 ·
Maintainers usually reply within 7 days