mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-26 09:52:31 +00:00
🐛 fix closed async backlog accounting
This commit is contained in:
@@ -36,6 +36,7 @@ Detailed rules explaining key parameters and behaviors
|
||||
- The counter increases when overflow policy discards records.
|
||||
- The counter can also increase when `close(clear=true)` or `shutdown(clear=true)` abandons queued records.
|
||||
- It can also increase when shutdown fallback logic converts remaining pending records into dropped records during a clear-close path.
|
||||
- Later log attempts against an already closed queue do not add to this counter by themselves.
|
||||
- This is a cumulative counter for the lifetime of the logger value.
|
||||
- Use this helper when you need a focused loss metric rather than a full `state()` snapshot.
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ Detailed rules explaining key parameters and behaviors
|
||||
- Context fields, patch logic, and filter logic are applied before enqueue.
|
||||
- If timestamping is enabled, `@env.now()` is captured before the record enters the queue.
|
||||
- Overflow behavior depends on the configured `AsyncOverflowPolicy`.
|
||||
- Closed-on-log behavior is runtime-dependent: compatibility runtimes short-circuit before enqueue work, while native-worker runtimes may still reach the queue operations and then treat a closed queue as a non-accepted write.
|
||||
|
||||
### How to Use
|
||||
|
||||
@@ -82,6 +83,8 @@ e.g.:
|
||||
|
||||
- If the logger is closed or overflow policy rejects the record, enqueue may not proceed as a normal accepted write.
|
||||
|
||||
- A closed queue does not count as a newly accepted pending record.
|
||||
|
||||
### Notes
|
||||
|
||||
1. Use this API when the call site needs full control instead of a fixed severity helper.
|
||||
|
||||
@@ -36,6 +36,7 @@ Detailed rules explaining key parameters and behaviors
|
||||
- The count increases when records are accepted into the queue.
|
||||
- The count decreases as the worker drains records.
|
||||
- The count is also reset to `0` when queued records are abandoned through clear-close paths such as `close(clear=true)`.
|
||||
- Log attempts against a closed queue do not create new pending backlog.
|
||||
- This is a point-in-time metric and may change immediately after it is read.
|
||||
- Use this helper when a single backlog number is enough and a full `state()` snapshot is unnecessary.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user