Commit e700ff2
committed
Fix bg fill teardown crash in update_size_and_time_stats
Production crash logs show ink_assert(0) firing in
HttpTransact::update_size_and_time_stats from HttpSM::update_stats via
HttpSM::kill_this, triggered by an Http2Stream event re-entering the
state machine while background_fill was still in the STARTED state.
The background_fill state is normally driven to a terminal value
(COMPLETED or ABORTED) by tunnel_handler_server, but when the SM is
torn down before that handler runs the state stays STARTED and the
unreachable default branch in update_size_and_time_stats asserts. The
same path also leaks proxy.process.http.background_fill_current_count
because tunnel_handler_server is the only site that decrements the
gauge after tunnel_handler_ua incremented it.
This normalizes STARTED to ABORTED at the top of HttpSM::update_stats
and decrements the gauge there, so the accounting balances and the
downstream stats helper sees a terminal state. As a defensive backstop
it also folds the STARTED case into the ABORTED branch of
update_size_and_time_stats so a future caller that reaches this point
mid-fill records the bytes against background_fill_bytes_aborted
instead of crashing the server.1 parent 450d3f3 commit e700ff2
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7777 | 7777 | | |
7778 | 7778 | | |
7779 | 7779 | | |
| 7780 | + | |
| 7781 | + | |
| 7782 | + | |
| 7783 | + | |
| 7784 | + | |
| 7785 | + | |
| 7786 | + | |
| 7787 | + | |
| 7788 | + | |
| 7789 | + | |
| 7790 | + | |
| 7791 | + | |
| 7792 | + | |
| 7793 | + | |
| 7794 | + | |
7780 | 7795 | | |
7781 | 7796 | | |
7782 | 7797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8957 | 8957 | | |
8958 | 8958 | | |
8959 | 8959 | | |
| 8960 | + | |
| 8961 | + | |
| 8962 | + | |
| 8963 | + | |
| 8964 | + | |
| 8965 | + | |
8960 | 8966 | | |
8961 | 8967 | | |
8962 | 8968 | | |
| |||
8968 | 8974 | | |
8969 | 8975 | | |
8970 | 8976 | | |
8971 | | - | |
8972 | 8977 | | |
8973 | 8978 | | |
8974 | 8979 | | |
| |||
0 commit comments