Reading Xray's stats advances the panel's baseline for them, so a poll whose accounting write then failed (a locked SQLite file, an aborted PostgreSQL transaction, a full writer queue) lost those bytes for good: the next poll measured only from the new baseline.
The poller now keeps the sample it could not save and retries that same sample before collecting another, also while Xray is down. Inbound, client and outbound counters of one sample commit in a single transaction together with a one-row receipt, so a write whose acknowledgement was lost is not counted twice. A failure in the lifecycle maintenance that runs after the commit no longer reports the sample as unsaved.
Run on a panel with real traffic: with the SQLite write lock held for 45 s, 20 MB passed through a VLESS inbound were dropped before this change and are counted once the lock is released after it.
Closes#7220