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

python plugin: topic 'shutdown' is not a known notification topic #4778

Closed
SimonVrouwe opened this issue Sep 9, 2021 · 1 comment · Fixed by #4779
Closed

python plugin: topic 'shutdown' is not a known notification topic #4778

SimonVrouwe opened this issue Sep 9, 2021 · 1 comment · Fixed by #4779

Comments

@SimonVrouwe
Copy link
Collaborator

SimonVrouwe commented Sep 9, 2021

Issue and Steps to Reproduce

Experimenting with a python plugin to catch the "shutdown" notification for cleanup, but plugin is never notified and CL has following in log:

plugin-thread_plugin.py: topic 'shutdown' is not a known notification topic

The plugin uses from pyln.client import Plugin (pyln-client 0.10.1) and subscribes to "shutdown" using the decorator @plugin.subscribe("shutdown")

getinfo output

edit "version": "v0.10.1" `"version": "v0.10.1-123-g84957be"

@SimonVrouwe
Copy link
Collaborator Author

SimonVrouwe commented Sep 9, 2021

After some investigation, changing plugin_shutdown to shutdown in this line solves it.

REGISTER_NOTIFICATION(plugin_shutdown, NULL);

EDIT: Ok I just see this code was all just added 6 days ago in #4754 , right in time!
Please ignore below.

What I don't understand is why build-in plugins don't complain with the same error, i.e. as build-in plugins seem to automatically subscribe to the "shutdown" notification. For example the autoclean plugins getmanifest result looks like:

{"jsonrpc":"2.0","id":0,"result":{"options":[{"name":"autocleaninvoice-cycle","type":"string","description":"Perform cleanup of expired invoices every given seconds, or do not autoclean if 0","deprecated":false},{"name":"autocleaninvoice-expired-by","type":"string","description":"If expired invoice autoclean enabled, invoices that have expired for at least this given seconds are cleaned","deprecated":false}],"rpcmethods":[{"name":"autocleaninvoice","usage":"[cycle_seconds] [expired_by]","description":"Set up autoclean of expired invoices. ","long_description":"Perform cleanup every {cycle_seconds} (default 3600), or disable autoclean if 0. Clean up expired invoices that have expired for {expired_by} seconds (default 86400). ","deprecated":false}],"subscriptions":["shutdown"],"hooks":[],"dynamic":false,"notifications":[]} }

this -> "subscriptions":["shutdown"]

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.

1 participant