-
Notifications
You must be signed in to change notification settings - Fork 41
Make ipdevpoll able to respond to refresh events #3348
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
base: master
Are you sure you want to change the base?
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Test results 12 files 12 suites 11m 54s ⏱️ For more details on these failures, see this check. Results for commit 79341e7. ♻️ This comment has been updated with latest results. |
61fc148
to
aa0ee5f
Compare
Things that seem to still be missing from this PR (I will update this comment as I find more):
|
aa0ee5f
to
ef62b95
Compare
EventEngine used to be the only subscriber to eventq update notifications from PostgreSQL, now ipdevpoll will be there too. It's nice for the targeted subsystem to be able to discern from the notification payload itself whether it needs to check the eventq table for new records or not.
This adds code for ipdevpoll to subscribe to event notifications from PostgreSQL, which it can use as a trigger for looking for refresh events targeted at it.
This is just for testing that the notification mechanism works.
We want to be able to easily map job names to existing JobHandler instances for incoming refresh events (so we can look up which JobHandler potentially needs to be told to reschedule a job for an immediate run)
This still doesn't reschedule anything, but it filters out incoming events that this process doesn't want to handle, and ignores/deletes events that no ipdevpoll process will handle. It also groups incoming events by netbox+jobname, in case there are multiple requests for the same job to be re-run (i.e. someone impatient keeps sending refresh events, or maybe ipdevpoll was down for a while and events queued up, or two separate users just happened to send the same refresh request at the same time).
This looks up the appropriate schedulers for each incoming refresh request and asks them to reschedule the next job to run immediately. This still does not provide receipts to the event source, that will have to come later.
88d4aac
to
52afa56
Compare
This program can be used to send refresh events to ipdevpoll "by hand".
52afa56
to
79341e7
Compare
|
Pulled this one out the "unfinished" archives and rebased to latest master. Will likely still need some work, so keeping it in draft mode.
Fixes #2626