Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metrics SDK] Shutdown false alarm #1744

Open
cijothomas opened this issue May 11, 2024 · 1 comment
Open

[Metrics SDK] Shutdown false alarm #1744

cijothomas opened this issue May 11, 2024 · 1 comment
Labels
A-metrics Area: issues related to metrics

Comments

@cijothomas
Copy link
Member

Originally discussed here: https://github.com/open-telemetry/opentelemetry-rust/pull/1623/files#r1527013980

#[test]
    fn test_shutdown_false_alarm() {
        let reader = TestMetricReader::new();
        let provider = super::SdkMeterProvider::builder()
            .with_reader(reader.clone())
            .build();

        // Initially, shutdown should not be called
        assert!(!reader.is_shutdown());

        // Shutdown the provider manually.
        provider.shutdown().unwrap();
        // Now the shutdown should be invoked
        assert!(reader.is_shutdown());

        // end of this block drops the provider,
        // which try to shutdown again,
        // triggering an error message.
        // that is unactionable for users....
    }
@cijothomas
Copy link
Member Author

cijothomas commented May 11, 2024

Not very high priority to fix, as the typical pattern would be for user to make a clone of the provider and hand it over to the set_global method, so even when their original provider is dropped, the meter_provider's inner is not dropped, as there is one clone still left.

@cijothomas cijothomas added the A-metrics Area: issues related to metrics label May 11, 2024
markdingram added a commit to markdingram/opentelemetry-rust that referenced this issue Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metrics Area: issues related to metrics
Projects
None yet
Development

No branches or pull requests

1 participant