"mysql" "Packets out of sync" - workaround

โš“ Rust    ๐Ÿ“… 2026-04-21    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 3      

surdeus

Ref: CodecError { Packets out of sync } - possible failed reconnect after timeout ยท Issue #412 ยท blackbeam/rust-mysql-simple ยท GitHub

I have something that connects to a remote MySQL database and sometimes computes for over an hour with no transaction in progress but the MySQL connection pool still alive. Then the next MySQL request fails with

Failed: CodecError { Packets out of sync }

probably because the server closed the connection.

This is probably a bug in lost idle connection recovery; if there's a connection pool, it's the pool manager's job to handle this. So I sent in a bug report.

Known bug? Known workaround?

(What I really need to do is speed up that hour-long compute. I'm scaling something up and it turned out to have a part that's too slow. I can fix that, but would like to see this run to completion before diving into optimization.)

1 post - 1 participant

Read full topic

๐Ÿท๏ธ Rust_feed