zhaofengli / attic

Multi-tenant Nix Binary Cache
https://docs.attic.rs
Other
965 stars 73 forks source link

Bug in `gc.rs` causing a `sqlx` panic that completely crashes `atticd` #115

Closed ixmatus closed 4 months ago

ixmatus commented 7 months ago

Specifically, we're getting this panic from atticd:

thread 'main' panicked at 'assertion failed: self.param_types.len() <= (u16::MAX as usize)'

... which is related to this sqlx issue: https://github.com/launchbadge/sqlx/issues/671#issuecomment-687043510 but only because the number of chunks to garbage collect have grown beyond psql's purported bind parameter limit.

We narrowed the issue down (via the stack trace) to this query:

https://github.com/zhaofengli/attic/blob/6eabc3f02fae3683bffab483e614bebfcd476b21/server/src/gc.rs#L184

This problem takes down atticd entirely. We will submit a PR to fix this but I wanted to open this ticket for tracking purposes.