apache / shenyu

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance.
https://shenyu.apache.org/
Apache License 2.0
8.35k stars 2.9k forks source link

[BUG] <title> In rulesList, The un-matching request will cause normal requests to fail #5588

Open creabob opened 5 days ago

creabob commented 5 days ago

Is there an existing issue for this?

Current Behavior

this is my rule setting in modifyResponse plugin

image

this is matching case

image

this is un-matching case without add body info

image

but after un-matching case, the matching case become un-match

image

this operates in orders

Expected Behavior

Whenever the request happens, the matching scene should be matched

Steps To Reproduce

  1. in shenyu-master branch
  2. set matching rules
  3. happen one un-matching case
  4. matching case will dismatch

Environment

ShenYu version(s):
master

Debug logs

this is the logs under matching case but un-matching and without modifyResponse rule success match info.

image

Anything else?

i have debug in this case, find some questions in this line, why caches an empty ruleData when not match rules.

image

cacheRuleData(path, emptyRuleData); when i delete this line ,this bug will be fixed. but i am not sure this operate is correct. Can u introduce the original intention of this line which cache empty ruleData?

creabob commented 5 days ago

besides, This problem not only exists in this plugin

moremind commented 4 days ago

please close rule cache in shenyu-bootstrap.yml

creabob commented 4 days ago

please close rule cache in shenyu-bootstrap.yml

so, it is recommended to turn on this rule cache function?

moremind commented 2 days ago

please close rule cache in shenyu-bootstrap.yml

so, it is recommended to turn on this rule cache function?

if your rule just exist url condition, you can turn on