1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! The Cypher engine's abort check — one poll, two reportable outcomes.
//!
//! Both engines route their deadline/cancel polls through here: the read
//! executor via `CypherExecutor::check_deadline`, the mutation engine via
//! `write::check_interrupt_periodic`. Keeping the wording in one place is what
//! lets the session layer classify the abort — a passed deadline is
//! [`KgError::CypherTimeout`], a raised cancel flag is [`KgError::Cancelled`] —
//! off the interrupt state rather than off this prose.
//!
//! [`KgError::CypherTimeout`]: crate::error::KgError::CypherTimeout
//! [`KgError::Cancelled`]: crate::error::KgError::Cancelled
use crateInterrupt;
/// Report which half of `interrupt` fired, if either.
///
/// The mutation engine used to run its own poller reporting a flat "Query
/// interrupted" for both, which is how a plain deadline on a write reached
/// callers as an unclassifiable execution failure.
pub
/// Wording for a fired deadline. Read by callers as prose only — the
/// timeout-vs-execution-failure classification is structural
/// (`session::execute::exec_err` re-reads the interrupt state), never a match
/// on this text.
const TIMEOUT_MESSAGE: &str = "Query timed out. Hints: anchor the query with MATCH (n {id: ...}) \
or a pattern property matching an indexed column (e.g. \
MATCH (n {label: 'X'})). To allow a longer run, pass \
timeout_ms=N to cypher() or set kg.set_default_timeout(ms); \
timeout_ms=0 disables the deadline.";
/// Wording for a raised cancel flag; matches the pattern matcher's
/// (`pattern_matching::matcher`) so both carriers read identically.
const CANCELLED_MESSAGE: &str = "Query cancelled";