-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add ability to do sns-based updates instead of webhooks #1920
Conversation
@@ -572,7 +573,10 @@ public SingularityCreateResult saveTaskHistoryUpdate(SingularityTaskHistoryUpdat | |||
|
|||
@Timed | |||
public SingularityCreateResult saveTaskHistoryUpdate(SingularityTaskHistoryUpdate taskHistoryUpdate, boolean overwriteExisting) { | |||
singularityEventListener.taskHistoryUpdateEvent(taskHistoryUpdate); | |||
Optional<SingularityTask> task = getTask(taskHistoryUpdate.getTaskId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only line I was hesitant about in the PR, but I still think it's a new improvement. With the previous version, we would be doing a write to zk here. Now we are doing a (mostly likely cached) read and a write to SNS/zk. The SNS update falls back to a zk write in case sns is down, so nothing should block here.
default: | ||
break; | ||
for (WebhookType type : WebhookType.values()) { | ||
for (SingularityWebhook webhook : webhookManager.getActiveWebhooksByType(type)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a switch to use the cached version of this data since it can be queried frequently
🚢 |
This is the first in a series of "let's be nicer to zookeeper" PRs. This adds the ability for Singularity to produce messages to SNS instead of backing webhook queues with zookeeper. This should reduce calls to zk by (task updates/second * num subscribers)
TODOs: