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

discuss: Allow to set custom timeout for route when route belongs to service or upstream #4258

Closed
xuchmao opened this issue May 16, 2021 · 13 comments
Assignees
Labels
discuss enhancement New feature or request good first issue Good for newcomers

Comments

@xuchmao
Copy link

xuchmao commented May 16, 2021

Issue description

Need to config custom timeout for route when route belongs to service or upstream.
Sometimes we don't want to use timeout configured in service or upstream but use custom timeout instead.

Environment

apisix version (cmd: apisix version): 2.3

@spacewander spacewander changed the title request help: Set custom timeout for route when route belongs to service or upstream discuss: Allow to set custom timeout for route when route belongs to service or upstream May 16, 2021
@spacewander
Copy link
Member

Wait for more votes to see if this FR is widely needed.

@tokers
Copy link
Contributor

tokers commented May 17, 2021

@xuchmao Indeed the Envoy xDS protoocl does this. But we still need some real scenarios to understand the necessary for this feature.

@tokers
Copy link
Contributor

tokers commented May 17, 2021

@xuchmao Indeed the Envoy xDS protoocl does this. But we still need some real scenarios to understand the necessary for this feature.

Could you paste some cases in real world?

@lujiajing1126
Copy link

@xuchmao Indeed the Envoy xDS protoocl does this. But we still need some real scenarios to understand the necessary for this feature.

Could you paste some cases in real world?

Obviously, uploading files should have longer timeout compared to a normal GET/POST

@FightingLiming
Copy link

When a service has multiple interfaces, the timeout period of each interface may be different.

@spacewander
Copy link
Member

We can pass through the timeout via ctx:

apisix/apisix/balancer.lua

Lines 138 to 140 in 0114c98

local up_conf = ctx.upstream_conf
if up_conf.timeout then
local timeout = up_conf.timeout

PR is welcome!

@spacewander spacewander added enhancement New feature or request good first issue Good for newcomers labels May 17, 2021
@yxudong
Copy link
Contributor

yxudong commented May 24, 2021

Hi, @spacewander I'd like work on this issue.
Please assign it to me.
But what extent should this feature be supported, like just precise match or should supprt regex match?

@spacewander
Copy link
Member

But what extent should this feature be supported, like just precise match or should supprt regex match?

I am confused. Doesn't we only need to add a timeout field as we have done with upstream?

@tokers
Copy link
Contributor

tokers commented May 25, 2021

Hi, @spacewander I'd like work on this issue.
Please assign it to me.
But what extent should this feature be supported, like just precise match or should supprt regex match?

It seems that what you talked about is another thing? If so, we may create another issue to track, and in this thread, let's talk about custom timeout settings.

@yxudong
Copy link
Contributor

yxudong commented May 25, 2021

Sorry, I misunderstood.
I'll work on this issue about custom timeout settings.

@tokers
Copy link
Contributor

tokers commented May 25, 2021

Sorry, I misunderstood.
I'll work on this issue about custom timeout settings.

Looking forward to your PR :)

@yxudong
Copy link
Contributor

yxudong commented Jun 1, 2021

The issue can be closed. @tokers

@tokers
Copy link
Contributor

tokers commented Jun 1, 2021

The issue can be closed. @tokers

Well done, thanks for your contribution!

@tokers tokers closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

6 participants