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

Add ability to do sns-based updates instead of webhooks #1920

Merged
merged 14 commits into from
Apr 25, 2019
Merged

Conversation

ssalinas
Copy link
Member

@ssalinas ssalinas commented Apr 16, 2019

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:

  • trace error handling back up for errors thrown in SingularityEventListener and make sure an SNS outage wouldn't cause issues on any critical path

@ssalinas ssalinas added the hs_qa label Apr 17, 2019
@@ -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());
Copy link
Member Author

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)) {
Copy link
Member Author

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

@pschoenfelder
Copy link
Contributor

🚢

@ssalinas ssalinas merged commit e1060d3 into master Apr 25, 2019
@ssalinas ssalinas deleted the sns_webhooks branch April 25, 2019 20:20
@ssalinas ssalinas added this to the 0.23.0 milestone Jun 7, 2019
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.

2 participants