Commit fe7551a
committed
chore: tighten error handling, document invariants, finish header migration
Bucket of small clarifications and the residual REUSE header migration.
- `error_mapping.rs`: replace the leak/debug-balance TODOs with a
cross-link to the new "Logging and information disclosure" section
in the README. The client-facing path is unchanged (still
sanitised); operator logs keep the raw Trino message.
- `session.rs`: doc-comment on `CANCEL_REGISTRY` now lists the two
drop sites that clean it up (`ConnectionCleanup` in main.rs and
`ConnectionState::Drop` here) and explains why the invariant holds
on idle TCP timeouts as well as normal close, error, and panic.
- `main.rs`: the over-cap connection drop is documented — the PG
protocol *does* allow a graceful `ErrorResponse` (SQLSTATE 53300),
but issuing it requires reading the StartupMessage first, which
defeats the SYN-flood mitigation. We close at the TCP level and
surface the cause via the `tracing::warn!`.
- `config.rs`: the `tls_cert` doc-comment used to say "operator-side
discipline for now" and pointed at a publication-checklist item.
`policy::validate` now enforces this at startup; comment updated.
- `startup.rs`: `rand::thread_rng().r#gen::<i32>()` -> `rand::random
::<i32>()`. The `r#gen` raw-identifier form was needed because
`gen` became a keyword in Rust 2024; `random()` sidesteps it.
Logging on credential check failure now mentions the broader
cause (auth rejection / network error / unreachable Trino) rather
than implying every failure is auth.
- `AGENTS.md`: added the `cargo llvm-cov --all-targets --html`
invocation under Build & Test, behind a `cargo install`
prerequisite note.
- All other touched files (cancel, handler, lib, policy, rewrite/*,
catalog/{pg_type,stubs}, build.rs, scripts/*.sh, tests/integration_test.rs):
inline SPDX header migration only. No content change.1 parent 022a073 commit fe7551a
22 files changed
Lines changed: 95 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
0 commit comments