Skip to content

Conversation

@cdbartholomew
Copy link
Contributor

Fixes #4612

Motivation

When running function workers separate from the broker, the proxy is supposed to forward function REST commands to the function worker(s), not the broker(s). This does not work since the function API is v3, but the proxy only works on v2 version of the API. This PR fixes that. It also forwards v3 sink and source command since those are served by the function worker(s) when running separately from the broker.

Modifications

Simple change to include extra V3 paths in the check for which endpoints to forward to the function worker.

Verifying this change

I have been running with this fix in multiple Pulsar setups with independent function workers for a while now. The proxy now forwards the V3 REST calls.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

if (requestUri.startsWith("/admin/v2/functions")
|| requestUri.startsWith("/admin/functions")) {
// Functions workers handle function, sources, and sinks endpoints
if (requestUri.startsWith("/admin/v3/functions")
Copy link
Member

Choose a reason for hiding this comment

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

a better change might using regex to match "/admin/v*/functions", "/admin/v*/sources" and "/admin/v*/sinks".

@sijie
Copy link
Member

sijie commented Mar 6, 2020

This was fixed by #6486

@sijie sijie closed this Mar 6, 2020
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.

Pulsar proxy not routing https requests to function workers

2 participants