From 555dac76a8810cfeaae96f8de04e9eb3362a3314 Mon Sep 17 00:00:00 2001 From: Imdad Ahad Date: Mon, 10 Jul 2017 15:38:11 +0100 Subject: [PATCH 1/2] Remove old notification status column --- .../versions/0109_rem_old_noti_status.py | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 migrations/versions/0109_rem_old_noti_status.py diff --git a/migrations/versions/0109_rem_old_noti_status.py b/migrations/versions/0109_rem_old_noti_status.py new file mode 100644 index 000000000..4d723a0ef --- /dev/null +++ b/migrations/versions/0109_rem_old_noti_status.py @@ -0,0 +1,45 @@ +""" + +Revision ID: 0109_rem_old_noti_status +Revises: 0108_change_logo_not_nullable +Create Date: 2017-07-10 14:25:15.712055 + +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +revision = '0109_rem_old_noti_status' +down_revision = '0108_change_logo_not_nullable' + + +def upgrade(): + op.drop_column('notification_history', 'status') + op.drop_column('notifications', 'status') + + +def downgrade(): + op.add_column( + 'notifications', + sa.Column( + 'status', + postgresql.ENUM( + 'created', 'sending', 'delivered', 'pending', 'failed', 'technical-failure', + 'temporary-failure', 'permanent-failure', 'sent', name='notify_status_type' + ), + autoincrement=False, + nullable=True + ) + ) + op.add_column( + 'notification_history', + sa.Column( + 'status', + postgresql.ENUM( + 'created', 'sending', 'delivered', 'pending', 'failed', 'technical-failure', + 'temporary-failure', 'permanent-failure', 'sent', name='notify_status_type' + ), + autoincrement=False, + nullable=True + ) + ) From bfdf9bc9a0b95cbfeceb5a05ad25ecff096e165e Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Mon, 17 Jul 2017 14:00:55 +0100 Subject: [PATCH 2/2] update kombu version to prevent 100% CPU usage This pulls in the most recent version of celery/kombu/master - it prevents situations where the celery MainProcess would consume 100% CPU while not distributing any tasks to the workers. Note: If, locally, you already have kombu==4.0.2, you'll have to run pip install --upgrade https://github.com/celery/kombu/zipball/b2f21289 to get the new version. --- requirements.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 452bfb96a..de027e13c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,8 +33,9 @@ awscli-cwlogs>=1.4,<1.5 git+https://github.com/alphagov/notifications-utils.git@17.5.3#egg=notifications-utils==17.5.3 # Kombu is a library that celery uses under the hood. -# Kombu is pinned to a specific commit that brings in fixes for SQS - see https://github.com/celery/kombu/pull/693 # Kombu v4.0.2 (which ships with celery v4.0.2) doesn't work with SQS due to problems with their use of boto2, so # Kombu migrated to boto3 - We're waiting for that to get a release version, and then to get a new version of celery # that pulls that in. Until that point, we should override the kombu version to get these SQS fixes. -git+https://github.com/celery/kombu@09bd23bbd83344b09cbf38b7257107e560db9f25 +# Additionally, kombu master also includes a fix for the main process taking 100% CPU and not distributing tasks (!) +# See https://github.com/celery/kombu/pull/693 and https://github.com/celery/kombu/pull/760 +https://github.com/celery/kombu/zipball/b2f21289284496efd89acea003ff9c24105b970e