Skip to content

Conversation

@arielb1
Copy link
Contributor

@arielb1 arielb1 commented Apr 23, 2025

📬 Issue #, if available:

✍️ Description of changes:

🔏 By submitting this pull request

  • I confirm that I've made a best effort attempt to update all relevant documentation.
  • I confirm that my contribution is made under the terms of the Apache 2.0 license.

Cargo.toml Outdated
aws-config = { version = "1", optional = true }
aws-sdk-s3 = { version = "1", optional = true }
chrono = "0.4"
futures = "0.3"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we specify the features we want rather than relying on default features?

.map(|reporter| reporter.report(jfr.clone(), metadata)),
)
.await;
// return the first error
Copy link
Collaborator

@jlizen jlizen Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems bad to swallow errors past the first? Since they could be totally different destination types / failure reasons?

I don't think Vec<Box<dyn std::error::Error + Send>> is good because it is unpleasant to interact with compared to something directly implementing std::error::Error.

Ideally we would fold the errors somehow, but still preserves per-reporter failure attribution.

Perhaps its worth adding an optional context() method on the Reporter trait that we default to empty, implement for S3Reporter, etc?

But even without that we could at least flatten down the errors in a way that maintains ordering if not direct context.

use std::fmt;

#[derive(Debug, thiserror::Error)]
pub struct MultiError {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a doc comment, even just something simple like "this is an aggregated error that includes per-reporter report errors identified by their debug impl")

@arielb1 arielb1 requested a review from jlizen April 23, 2025 22:05
@arielb1 arielb1 merged commit 6aa596b into async-profiler:main Apr 23, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants