Skip to content

libsql: Open a fresh stream in HttpConnection::prepare()#2108

Closed
penberg wants to merge 1 commit intomainfrom
prepare-fresh-stream
Closed

libsql: Open a fresh stream in HttpConnection::prepare()#2108
penberg wants to merge 1 commit intomainfrom
prepare-fresh-stream

Conversation

@penberg
Copy link
Copy Markdown
Collaborator

@penberg penberg commented Jun 22, 2025

The server expires idle streams in 10 seconds. Therefore, let's not even attempt to reuse the same stream for preparing a new SQL statement.

The server expires idle streams in 10 seconds. Therefore, let's not even
attempt to reuse the same stream for preparing a new SQL statement.
}

pub async fn prepare(&self, sql: &str) -> crate::Result<Statement<T>> {
let stream = self.current_stream().clone();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the expired stream get properly cleaned up?
Is it possible to check the current stream to see if it's a live and reuse it, if it's dead open a new stream - does that improve anything?

@penberg
Copy link
Copy Markdown
Collaborator Author

penberg commented Jun 26, 2025

Obsoleted by server side fix. The "hrana" v3 protocol really does expect sessions not to expire as aggressively, so fixed that on server side.

@penberg penberg closed this Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants