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

springmvc adaptor didn't exit context when request is blocked #1350

Closed
cdfive opened this issue Mar 21, 2020 · 0 comments · Fixed by #1353
Closed

springmvc adaptor didn't exit context when request is blocked #1350

cdfive opened this issue Mar 21, 2020 · 0 comments · Fixed by #1353
Labels
area/integrations Issues or PRs related to integrations with open-source components kind/bug Category issues or prs related to bug.
Milestone

Comments

@cdfive
Copy link
Collaborator

cdfive commented Mar 21, 2020

Issue Description

Add one flow rule with callerA, if one request from callerA is blocked,
there are some chances that the next requests from other caller will be still blocked,
since the context didn't exit and the web server(e.g. tomcat) may reuse thread.

Describe what you expected to happen

Request from other caller shoud be passed,
and the context should be exit when one request is completed.

How to reproduce it (as minimally and precisely as possible)

I fount it in SentinelSpringMvcIntegrationTest#testOriginParser, the third case with
"/foo/3" url and no header, and wondering why it expects blocked.

Reproduce it in demo:

  1. Modify the InterceptorConfig#Line62 in sentinel-demo-spring-webmvc
    config.setOriginParser(request -> request.getHeader("S-user")); to
    config.setOriginParser(request -> request.getParameter("S-user"));

  2. Start web demo and dashboard

  3. Add a flow rule for resource GET:/hello, with caller "aaa" and threshold "0"

  4. Visit /host:port/hello?S-user=aaa, and it will be blocked by Sentinel,
    then visit /host:port/hello?S-user=bbb or /host:port/hello for many times, they will be blocked occasionally.

@cdfive cdfive added area/integrations Issues or PRs related to integrations with open-source components kind/bug Category issues or prs related to bug. labels Mar 22, 2020
@sczyh30 sczyh30 added this to the 1.7.2 milestone Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integrations Issues or PRs related to integrations with open-source components kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants