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

Old instances of plugin not getting deleted #28

Closed
abhisheksharma2805 opened this issue Oct 27, 2021 · 2 comments · Fixed by #64
Closed

Old instances of plugin not getting deleted #28

abhisheksharma2805 opened this issue Oct 27, 2021 · 2 comments · Fixed by #64

Comments

@abhisheksharma2805
Copy link

I have 5 multiple instances of the same plugin (different config) applied to 5 different services. I was just testing the setup by disabling and enabling the plugin. After enabling the plugin again, pdk created a new instance #6 but did not delete the older instance. Is this expected? I see the following error logs when I enable the plugin again. Seems like it is unable to close the instance. This is not affecting anything, the requests are being forwarded correctly but unnecessarily kong is maintaining the older instances which are not being used.

2021/10/27 11:52:34 [info] 30#0: *16 [py:32] INFO - [19:52:34] instance #6 of auth_plugin started, context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32] ERROR - [19:52:34] rpc: #85 exception: Traceback (most recent call last):, context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32]   File "/usr/local/lib/python3.6/site-packages/kong_pdk/listener.py", line 68, in handle, context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32]     ret = getattr(self.ps, cmd_r)(*args), context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32]   File "/usr/local/lib/python3.6/site-packages/kong_pdk/server.py", line 49, in wrapper, context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32]     raise(ex), context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32]   File "/usr/local/lib/python3.6/site-packages/kong_pdk/server.py", line 46, in wrapper, context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32]     r = fn(*args, **kwargs), context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32]   File "/usr/local/lib/python3.6/site-packages/kong_pdk/server.py", line 262, in close_instance, context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32]     "Name": ins['name'],, context: ngx.timer
2021/10/27 11:52:34 [info] 30#0: *16 [py:32] TypeError: 'Instance' object is not subscriptable, context: ngx.timer
@fffonion
Copy link
Collaborator

@abhisheksharma2805 Just to double check when you mean enablding/disabling the plugin is it something
like attaching it to a Service then delete it? There might be a bug, let me try to reproduce.

@abhisheksharma2805
Copy link
Author

@fffonion Yes, setting plugin.enabled = false or even deleting the plugin and re-attaching to the service is throwing this error. Basically I also see that updating any config parameter of the plugin it throws this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants