Expand description
Background work whose panic comes back as a TaskFailed (api.md E15).
Work run apart from its caller — on the blocking pool, as its own task, or
as one message of a long-lived loop — whose panic comes back to that
caller as a value instead of an unwind (api.md E15).
A panic turned into an Err at the nearest join lets the caller’s own
failure path run: the rollback or cleanup it does on Err, which an unwind
would skip. The caller reports the panic as a bug. Work nobody waits for,
a long-lived worker or work its caller stopped waiting for, reports its
panic to a BugSink instead, the app’s own reporter.
Structs§
- Bug
- Work that panicked: a bug in it, not a failure its caller can act on (E15). The caller reports it wherever it reports its own bugs, and the call that ran the work returns it as its error.
- Completing
Task - The result of work
spawn_completingorblocking_completingruns. Dropping it leaves the work running, and the work’s panic, or a bug its error carries, goes to the sink: once the work ends, or as it drops, for an answer the work gave that no one read. - Heard
Bugs - Keeps every bug it hears of, and logs each at error, as an app’s crash reporter would: the sink a test gives coven. A test that expects a bug takes it; one left untaken when the sink drops fails the test, so a bug no test expected never passes unseen.
- Logged
Bugs - Logs each bug at error: the sink of an app that wants its bugs only logged.
- Owned
Task - A task
spawn_ownedstarted. Dropping it leaves the task running. - Shutdown
- Work its runtime dropped as it shut down, before the work finished. Not a bug: the process is ending the work. The caller gets it as a value and returns it as its own error (E15).
- Source
Location - Where in the code a bug showed itself: the file, line and column of the panic, or of the code that found the bug and made it.
Enums§
- BugKind
- How a bug showed itself (E15).
- Shutdown
Outcome - How far work its runtime dropped got (E15).
- Task
Failed - Why work apart from its caller gave no result.
Traits§
- BugSink
- Where a bug in work nobody waits for goes (E15): a store’s long-lived
workers, such as its sync loop and upload worker, and work whose caller
stopped waiting for it. The app passes its own crash reporter to
Coven::new. - Carries
Bug - An error that may carry a bug: work its call ran panicked, and the call’s error says so (E15). Work nobody waits for reports the bug its error carries, as it reports its own panic.
Functions§
- blocking
- Run
workon the blocking pool. A panic in it, or the runtime dropping it unstarted (ShutdownOutcome::NotRun), comes back asTaskFailed, never as an unwind. - blocking_
completing - Run
work, namedoperation, on the blocking pool, where it runs to its end even when its caller stops waiting. Its panic comes back asTaskFailed::Panickedto a caller still waiting, and the pool dropping it unstarted asShutdownwithShutdownOutcome::NotRun. Once no caller waits, the panic goes tobugs, as does a bug its error carries. - catching_
operation - The operation of the innermost catch of coven’s running on this thread,
or
Noneoutside every one: for the app’s own panic hook, to say what the panicking work was doing. A panic a catch inside that work handles itself, such as a task tokio runs on this thread and catches, still names it. It never panics, so a hook can call it: a panic inside a hook ends the process. - caught
- Run
workinline, catching a panic in any of its polls. For one message of a long-lived loop: the panic fails that message and the loop serves the next. Run inline, the work can’t be dropped by its runtime, so a panic is its only failure. - caught_
sync caughtfor a synchronous call: an FFI callback, a dedicated thread’s body, aDrop. Unwinding out of anextern "C"function aborts the process, so such a function catches here and answers with its own failure value.- joined
- Wait for a task whose work runs under
caught, astokio::spawn(caught(operation, work))starts it. Its panic comes back asTaskFailed::Panicked, naming where it began; the runtime cancelling it, asShutdown. - panic_
message - The text a panic carried: what
panic!andexpectwere given, or a placeholder for a payload that is not text. - report
- Hand
bugtobugs. A sink that panics too is logged, and its panic goes no further: it runs where nothing above it catches. - report_
carried - Hand the bug
errorcarries, if it carries one, tobugs: the error of work nobody waits for, which no caller hears of. Whether it carried one, so the work logs an error that carried none. - reported
error, once the bug it carries, if any, has gone tobugs: the error of work nobody waits for, which it records where readers see it.- spawn_
completing - Run
work, namedoperation, as its own task, so it finishes even when its caller stops waiting, as closing a store does. Its panic comes back asTaskFailed::Panickedto a caller still waiting. Once none is, the panic goes tobugs, as does a bug its error carries. - spawn_
owned - Run
work, namedoperation, as its own task that nobody waits for: a worker its owner stops. A panic in it goes tobugs, thenendedruns, so the owner ends what the work served in a way its readers see, such as recording that sync failed. A panic inendedgoes tobugstoo, and no further.
Type Aliases§
- BugSink
Ref - A shared
BugSink.