Skip to content

Commit 32035cb

Browse files
committed
doc comment
1 parent ad94202 commit 32035cb

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

examples/metrics-basic/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async fn main() {
141141
// however shutting down the MeterProvider here instantly flushes
142142
// the metrics, instead of waiting for the 30 sec interval.
143143
let shutdown_result = meter_provider.shutdown();
144-
144+
145145
// Demonstrate handling the shutdown result.
146146
match shutdown_result {
147147
Ok(_) => println!("MeterProvider shutdown successfully"),

opentelemetry-sdk/src/error.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,30 @@ pub trait ExportError: std::error::Error + Send + Sync + 'static {
1313
#[derive(Error, Debug)]
1414
/// Errors that can occur during shutdown.
1515
pub enum ShutdownError {
16-
/// Shutdown already invoked.
16+
/// Shutdown has already been invoked.
17+
///
18+
/// While shutdown is idempotent and calling it multiple times has no
19+
/// impact, this error suggests that another part of the application is
20+
/// invoking `shutdown` earlier than intended. Users should review their
21+
/// code to identify unintended or duplicate shutdown calls and ensure it is
22+
/// only triggered once at the correct place.
1723
#[error("Shutdown already invoked")]
1824
AlreadyShutdown,
1925

2026
/// Shutdown timed out before completing.
27+
///
28+
/// This does not necessarily indicate a failure—shutdown may still be
29+
/// complete. If this occurs frequently, consider increasing the timeout
30+
/// duration to allow more time for completion.
2131
#[error("Shutdown timed out after {0:?}")]
2232
Timeout(Duration),
2333

24-
/// Shutdown failed with an error.
25-
/// This error is returned when the shutdown process failed with an error.
34+
/// Shutdown failed due to an internal error.
35+
///
36+
/// The error message is intended for logging purposes only and should not
37+
/// be used to make programmatic decisions. It is implementation-specific
38+
/// and subject to change without notice. Consumers of this error should not
39+
/// rely on its content beyond logging.
2640
#[error("Shutdown failed: {0}")]
2741
InternalFailure(String),
2842
}

0 commit comments

Comments
 (0)