Skip to content

dynamic_modules: support for http callouts - #39151

Merged
mathetake merged 17 commits into
envoyproxy:mainfrom
mathetake:httpcallouts
May 5, 2025
Merged

mathetake merged 17 commits into
envoyproxy:mainfrom
mathetake:httpcallouts

Conversation

@mathetake

@mathetake mathetake commented Apr 17, 2025 •

Copy link
Copy Markdown
Member

Commit Message: dynamic_modules: support for http callouts
Additional Description:

This adds support for http callouts initiated from HTTP filter context. More precisely, this adds a new ABI function:

  • envoy_dynamic_module_callback_http_filter_http_callout
  • envoy_dynamic_module_on_http_filter_http_callout_done

Risk Level: low
Testing: unit+integration
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #39151 was opened by mathetake.

see: more, trace.

Signed-off-by: Takeshi Yoneda <[email protected]>
@mathetake

Copy link
Copy Markdown
Member Author

tomorrow i will continue working on the integration test and then good to go

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
@mathetake mathetake mentioned this pull request Apr 17, 2025
11 tasks done
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
@mathetake
mathetake marked this pull request as ready for review April 18, 2025 01:46
@mathetake
mathetake requested a review from mattklein123 as a code owner April 18, 2025 01:46
@ravenblackx

Copy link
Copy Markdown
Contributor

Ping @mattklein123 for senior maintainer review.

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/wait

DynamicModuleHttpFilter::HttpCalloutCallback& callback = *iterator->second;
auto request = cluster->httpAsyncClient().send(std::move(message), callback, options);
if (!request) {
ENVOY_LOG(error, "Failed to send HTTP callout");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't remember but I think this one can fail due to legitimate runtime issues like no healthy upstream? I don't think you should log spam on this one. You need to either use a backoff log, metric, etc. The ones above seem like general config/programming errors to me so I guess OK.

@mathetake mathetake May 4, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, that's a valid concern. I changed the ABI to return the status instead of the boolean so that it doesn't need to log at all in the first place. a739f72

(i think we should switch to this status style elsewhere as well but i can take a shot at it in follow ups)

@mathetake
mathetake merged commit 4f974bd into envoyproxy:main May 5, 2025
@mathetake
mathetake deleted the httpcallouts branch May 5, 2025 17:50
mathetake added a commit to envoyproxy/dynamic-modules-examples that referenced this pull request Jun 24, 2025
Notably, the latest main comes with:
* Scheduler ABI: envoyproxy/envoy#39765
* Callouts ABI: envoyproxy/envoy#39151

Signed-off-by: Takeshi Yoneda <[email protected]>
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.

3 participants