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

Support cancellation of NGINX Plus API calls #205

Closed
Tracked by #368
pleshakov opened this issue Jan 18, 2024 · 4 comments · Fixed by #383
Closed
Tracked by #368

Support cancellation of NGINX Plus API calls #205

pleshakov opened this issue Jan 18, 2024 · 4 comments · Fixed by #383
Assignees
Labels
refined Issues that are ready to be prioritized
Milestone

Comments

@pleshakov
Copy link
Contributor

pleshakov commented Jan 18, 2024

Is your feature request related to a problem? Please describe.

As a developer, I'd like to be able to cancel any call I make to NGINX Plus API.

This is required for my software for:

  • graceful termination. When that happens, I'd like to be able to quickly terminate any in-progress API calls.
  • configuring a API call timeout. I'd like to control how long I can allow a call to NGINX Plus API to last.

Describe the solution you'd like

Using Context https://pkg.go.dev/context#Context is common for that.

func (client *NginxClient) AddHTTPServer(upstream string, server UpstreamServer) error {

func (client *NginxClient) AddHTTPServer(ctx context.Context, upstream string, server UpstreamServer) error {

Describe alternatives you've considered

There is hard-corded timeout that internally creates a context that ensures that a request to NGINX Plus API can't take longer than 10s.
https://github.com/nginxinc/nginx-plus-go-client/blob/970573b15737ed294b847ff19989bf9d0e6b182c/client/nginx.go#L855

However, I'd like to control cancelation via a context (which can be cancelled before timeout expires). Additionally, I want to control the value of the timeout.

Additional context

This comment was marked as outdated.

@github-actions github-actions bot added the stale Pull requests/issues with no activity label Mar 19, 2024

This comment was marked as outdated.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 26, 2024
@lucacome lucacome removed the stale Pull requests/issues with no activity label Jun 20, 2024
@lucacome lucacome reopened this Jun 20, 2024
@mpstefan mpstefan added the help wanted Issues identified as good community contribution opportunities label Jul 3, 2024
@mpstefan mpstefan added refined Issues that are ready to be prioritized and removed help wanted Issues identified as good community contribution opportunities labels Jul 17, 2024
@mpstefan
Copy link

Added @oliveromahony on Agent team for implementation. Let us know if this is wrong!

@mpstefan mpstefan removed the backlog Pull requests/issues that are backlog items label Sep 11, 2024
@oliveromahony
Copy link
Contributor

@mpstefan my current workload and availability in the next month doesn't allow me to do this as a priority. If someone else can take it on that would be great. I'll sync with the team tomorrow

@mpstefan mpstefan added the backlog Pull requests/issues that are backlog items label Sep 12, 2024
@lucacome lucacome mentioned this issue Sep 12, 2024
2 tasks
@lucacome lucacome added this to the v2.0.0 milestone Sep 12, 2024
@lucacome lucacome removed the backlog Pull requests/issues that are backlog items label Sep 18, 2024
@lucacome lucacome self-assigned this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refined Issues that are ready to be prioritized
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants