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

fix: event_queue fixes #282

Merged
merged 2 commits into from
Sep 19, 2023
Merged

fix: event_queue fixes #282

merged 2 commits into from
Sep 19, 2023

Conversation

adityathebe
Copy link
Member

@adityathebe adityathebe commented Sep 18, 2023

Async events, like notification.send, are created from the application; unlike sync events which are created with DB triggers. Due to this reason, we do not have PG notify triggers when async events are inserted. As a result, async event consumers never run in real-time and rely on the 1 minute timeout. (This was fine so far, because no matter which event was inserted, the pgnotify was picked up by all consumers. But now we have specific pg notify channels)

Instead of publishing pgnotify during insertion from multiple trigger functions, this PR adds a trigger on the event_queue table itself.


Also

  • added ON CONFLICT clauses on insertion to event queue
  • Ignore adding to event queue if component.status = unknown

Resolves: flanksource/canary-checker#1259

@github-actions
Copy link

github-actions bot commented Sep 18, 2023

E2E -

0 tests   0 ✔️  0s ⏱️
0 suites  0 💤
0 files    0

Results for commit 6576142.

♻️ This comment has been updated with latest results.

@adityathebe adityathebe changed the title fix: pg notify for async events fix: event_queue fixes Sep 19, 2023
* do not insert unknown component status updates to event_queue
@adityathebe adityathebe force-pushed the fix/pg_notify_async_events branch from 2b970fd to 6576142 Compare September 19, 2023 04:21
@moshloop moshloop merged commit 75277f7 into main Sep 19, 2023
6 checks passed
@moshloop moshloop deleted the fix/pg_notify_async_events branch September 19, 2023 06:52
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 this pull request may close these issues.

Topology job is failing
2 participants