Skip to content

Commit

Permalink
fix(http provider): correctly propagate Result to caller
Browse files Browse the repository at this point in the history
Problem: The HTTP config provider has been failing to parse the provided
TOML from its endpoint when polled. My best guess is that including the
`?` on the end of the http provider load results in the TOML parser
subtly exploding due to the aliased return type (`BuildResult`).

It appears that this was broken in
`8ed9ec24c1eba0b2191d7c1f24ec2a7540b5bebf`.

See vectordotdev#21873 for the initial
issue report.

Solution: Correctly propagate the `ConfigBuilder` by not using the `?`
operator. This appears to allow the TOML parser to correctly pick up on
the return type.

-----

Thanks to @jszwedko for the bisect, saved a ton of pain for me.

closes vectordotdev#21873
  • Loading branch information
PriceHiller committed Dec 8, 2024
1 parent d4854de commit e48e0b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async fn http_request_to_config_builder(
.await
.map_err(|e| vec![e.to_owned()])?;

config::load(config_str.chunk(), crate::config::format::Format::Toml)?
config::load(config_str.chunk(), crate::config::format::Format::Toml)
}

/// Polls the HTTP endpoint after/every `poll_interval_secs`, returning a stream of `ConfigBuilder`.
Expand Down

0 comments on commit e48e0b4

Please sign in to comment.