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

bug: update plugin config for route does not take effect #2870

Closed
nic-chen opened this issue Nov 27, 2020 · 2 comments · Fixed by #2901
Closed

bug: update plugin config for route does not take effect #2870

nic-chen opened this issue Nov 27, 2020 · 2 comments · Fixed by #2901
Assignees
Labels
bug Something isn't working plugin

Comments

@nic-chen
Copy link
Member

Issue description

Update the plugin config for route, and then access to the route, the plugin config is not updated.

Environment

  • apisix version (cmd: apisix version): master source
  • OS: macOS

Minimal test code / Steps to reproduce the issue

  1. create route
$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
    "uri": "/opentracing",
    "plugins": {
        "http-logger": {
            "uri": "http://172.16.238.20:1982/hello",
            "batch_max_size": 1,
            "max_retry_count": 1,
            "retry_delay": 2,
            "buffer_duration": 2,
            "inactive_timeout": 2,
            "name": "http logger",
            "timeout": 3,
            "concat_method": "json"
        }
    },
    "upstream": {
        "type": "roundrobin",
        "nodes": [{
            "host": "172.16.238.20",
            "port": 1981,
            "weight": 1
        }]
    }
}'
  1. access the route
$ curl http://127.0.0.1:9080/opentracing
  1. update the route
$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
    "uri": "/opentracing",
    "plugins": {
        "http-logger": {
            "uri": "http://172.16.238.20:8888/hello",
            "batch_max_size": 1,
            "max_retry_count": 1,
            "retry_delay": 2,
            "buffer_duration": 2,
            "inactive_timeout": 2,
            "name": "http logger",
            "timeout": 3,
            "concat_method": "json"
        }
    },
    "upstream": {
        "type": "roundrobin",
        "nodes": [{
            "host": "172.16.238.20",
            "port": 1980,
            "weight": 1
        }]
    }
}'
  1. access the route again
$ curl http://127.0.0.1:9080/opentracing

What's the actual result? (including assertion message & call stack if applicable)

upstream has changed to 172.16.238.20:1980

but log is still pushed to http://172.16.238.20:1982/hello

What's the expected result?

log should push to http://172.16.238.20:8888/hello

@membphis membphis added bug Something isn't working plugin labels Nov 27, 2020
@tokers
Copy link
Contributor

tokers commented Nov 27, 2020

The old log_buffer object was still in use after the route was updated.

@tokers
Copy link
Contributor

tokers commented Nov 27, 2020

Assigned to me.

@tokers tokers self-assigned this Nov 27, 2020
membphis pushed a commit that referenced this issue Dec 1, 2020
* change: changed log level when delete stale batch processor objects

close #2870
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants