Skip to content

bug:config_etcd did not handle the watcher be canceled #2680

@linxinshuo

Description

@linxinshuo

Issue description

Current version, the config_etcd watch different prefixes and maintain revisions separately, when some prefix be modified, the others can not perceive revision change. If etcd enable auto compacted, the watcher with old revision will be canceled because revision be compacted.
hope the watcher can handle the canceled result, re-pull the latest revision and re-watch

In current version(2.0), canceled response will case panic
2020/11/10 10:23:25 [error] 46#0: *16354 [lua] config_etcd.lua:448: failed to fetch data from etcd:

/usr/local/apisix/apisix/core/etcd.lua:115: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
[C]: in function 'ipairs'
/usr/local/apisix/apisix/core/etcd.lua:115: in function 'waitdir'
/usr/local/apisix/apisix/core/config_etcd.lua:255: in function 'sync_data'
/usr/local/apisix/apisix/core/config_etcd.lua:424: in function </usr/local/apisix/apisix/core/config_etcd.lua:414>
[C]: in function 'xpcall'
/usr/local/apisix/apisix/core/config_etcd.lua:414: in function </usr/local/apisix/apisix/core/config_etcd.lua:405>, etcd key: /apisix/plugin_metadata, context: ngx.timer

Environment

  • apisix version (cmd: apisix version): 2.0
  • OS:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions