Issue 1:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version: 4.2.1 (windowlicker)

celery report Output:

software -> celery:4.2.1 (windowlicker) kombu:4.6.3 py:3.6.6
billiard:3.5.0.5 redis:3.3.11
platform -> system:Darwin arch:64bit imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:redis results:redis://localhost:6379/9

ABSOLUTE_URL_OVERRIDES: {
}
ADMINS: []
ALLOWED_EXTENSIONS: {'jpg', 'jpeg', 'pdf', 'png'}
ALLOWED_HOSTS: ['*']
APPEND_SLASH: True
AUTHENTICATION_BACKENDS: ['django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS: '********'
AUTH_USER_MODEL: 'auth.User'
BASE_DIR: '/Users/rohanjaswal/PycharmProjects/policies'
CACHES: {
'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS: 'default'
CACHE_MIDDLEWARE_KEY_PREFIX: '********'
CACHE_MIDDLEWARE_SECONDS: 600
CELERY_BROKER_URL: 'redis://localhost:6379/10'
CELERY_MAX_TASKS_PER_CHILD: 10
CELERY_RESULT_BACKEND: 'redis://localhost:6379/9'
CELERY_TASK_DEFAULT_QUEUE: 'policies_panel_queue'
CORS_ALLOW_CREDENTIALS: True
CORS_ORIGIN_WHITELIST: ['localhost',
'localhost.pasarpolis.com',
'alpha.pasarpolis.com',
'pasarpolis.com']
CSRF_COOKIE_AGE: 31449600
CSRF_COOKIE_DOMAIN: None
CSRF_COOKIE_HTTPONLY: False
CSRF_COOKIE_NAME: 'csrftoken'
CSRF_COOKIE_PATH: '/'
CSRF_COOKIE_SECURE: False
CSRF_FAILURE_VIEW: 'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME: 'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS: []
CSRF_USE_SESSIONS: False
DATABASES: {
'default': { 'ATOMIC_REQUESTS': False,
'AUTOCOMMIT': True,
'CONN_MAX_AGE': 3600,
'ENGINE': 'mysql.connector.django',
'HOST': 'localhost',
'NAME': 'pp_policies',
'OPTIONS': {'use_pure': True},
'PASSWORD': '********',
'PORT': '',
'TEST': { 'CHARSET': None,
'COLLATION': None,
'MIRROR': None,
'NAME': None},
'TIME_ZONE': None,
'USER': 'rohan'}}
DATABASE_ROUTERS: '********'
DATA_UPLOAD_MAX_MEMORY_SIZE: 10485760
DATA_UPLOAD_MAX_NUMBER_FIELDS: 1000
DATETIME_FORMAT: 'N j, Y, P'
DATETIME_INPUT_FORMATS: ['%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%Y-%m-%d',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%Y',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M',
'%m/%d/%y']
DATE_FORMAT: 'N j, Y'
DATE_INPUT_FORMATS: ['%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y']
DEBUG: True
DEBUG_PROPAGATE_EXCEPTIONS: False
DECIMAL_SEPARATOR: '.'
DEFAULT_CHARSET: 'utf-8'
DEFAULT_CONTENT_TYPE: 'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER: 'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE: 'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL: 'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE: ''
DEFAULT_TABLESPACE: ''
DISALLOWED_USER_AGENTS: []
EMAIL_BACKEND: 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST: 'localhost'
EMAIL_HOST_PASSWORD: '********'
EMAIL_HOST_USER: ''
EMAIL_PORT: 25
EMAIL_SSL_CERTFILE: None
EMAIL_SSL_KEYFILE: '********'
EMAIL_SUBJECT_PREFIX: '[Django] '
EMAIL_TIMEOUT: None
EMAIL_USE_LOCALTIME: False
EMAIL_USE_SSL: False
EMAIL_USE_TLS: False
ENVIRONMENT: 'LOCAL'
FILE_CHARSET: 'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS: None
FILE_UPLOAD_HANDLERS: ['django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE: 2621440
FILE_UPLOAD_PERMISSIONS: None
FILE_UPLOAD_TEMP_DIR: None
FIRST_DAY_OF_WEEK: 0
FIXTURE_DIRS: []
FORCE_SCRIPT_NAME: None
FORMAT_MODULE_PATH: None
FORM_RENDERER: 'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS: []
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'core',
'api',
'corsheaders',
'raven.contrib.django.raven_compat',
'django_celery_beat']
INTERNAL_IPS: []

LANGUAGES: [('af', 'Afrikaans'),
('ar', 'Arabic'),
('ast', 'Asturian'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('be', 'Belarusian'),
('bn', 'Bengali'),
('br', 'Breton'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('dsb', 'Lower Sorbian'),
('el', 'Greek'),
('en', 'English'),
('en-au', 'Australian English'),
('en-gb', 'British English'),
('eo', 'Esperanto'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-co', 'Colombian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('es-ve', 'Venezuelan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy', 'Frisian'),
('ga', 'Irish'),
('gd', 'Scottish Gaelic'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hsb', 'Upper Sorbian'),
('hu', 'Hungarian'),
('ia', 'Interlingua'),
('id', 'Indonesian'),
('io', 'Ido'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('kab', 'Kabyle'),
('kk', 'Kazakh'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('lb', 'Luxembourgish'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('mr', 'Marathi'),
('my', 'Burmese'),
('nb', 'Norwegian Bokmål'),
('ne', 'Nepali'),
('nl', 'Dutch'),
('nn', 'Norwegian Nynorsk'),
('os', 'Ossetic'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('sw', 'Swahili'),
('ta', 'Tamil'),
('te', 'Telugu'),
('th', 'Thai'),
('tr', 'Turkish'),
('tt', 'Tatar'),
('udm', 'Udmurt'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('vi', 'Vietnamese'),
('zh-hans', 'Simplified Chinese'),
('zh-hant', 'Traditional Chinese')]
LANGUAGES_BIDI: ['he', 'ar', 'fa', 'ur']
LANGUAGE_CODE: 'en-us'
LANGUAGE_COOKIE_AGE: None
LANGUAGE_COOKIE_DOMAIN: None
LANGUAGE_COOKIE_NAME: 'django_language'
LANGUAGE_COOKIE_PATH: '/'
LOCALE_PATHS: []
LOGGING: {
'disable_existing_loggers': False,
'formatters': { 'standard': { 'format': '%(asctime)s [%(levelname)s] '
'%(name)s: %(message)s'}},
'handlers': { 'default': { 'class': 'logging.StreamHandler',
'formatter': 'standard',
'level': 'DEBUG'}},
'loggers': { '': { 'handlers': ['default'],
'level': 'DEBUG',
'propagate': True},
'django.request': { 'handlers': ['default'],
'level': 'DEBUG',
'propagate': False}},
'version': 1}
LOGGING_CONFIG: 'logging.config.dictConfig'
LOGGING_FOLDER: '/Users/rohanjaswal/PycharmProjects/policies/logs'
LOGIN_REDIRECT_URL: '/accounts/profile/'
LOGIN_URL: '/accounts/login/'
LOGOUT_REDIRECT_URL: None
LOG_NAME: 'POLICIES_LOG'
MANAGERS: []
MEDIA_ROOT: ''
MEDIA_URL: ''
MESSAGE_STORAGE: 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE: ['raven.contrib.django.middleware.DjangoRestFrameworkCompatMiddleware',
'raven.contrib.django.middleware.SentryMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'middleware.request_logging_middleware.RequestLoggingMiddleware']
MIGRATION_MODULES: {
}
MONTH_DAY_FORMAT: 'F j'
NUMBER_GROUPING: 0
PASSWORD_HASHERS: '********'
PASSWORD_RESET_TIMEOUT_DAYS: '********'
PREPEND_WWW: False
PROJECT_ID: 'testing-200706'
RAVEN_CONFIG: {
'dsn': '',
'environment': 'local',
'release': 'e01c8bd3d57c16718c21792ac0c11de47b72776a'}
REDIS: {
'HOST': 'localhost', 'PASSWORD': '********', 'PORT': '6379'}
REDIS_ACTIVATION_QR_CODE_DICT: 'activation_qr_codes'
REDIS_SCREEN_CACHE: 'screen_content'
REST_FRAMEWORK: {
'DEFAULT_AUTHENTICATION_CLASSES': ( 'api.authentication.PPJWTAuthentication',),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated',),
'PAGE_SIZE': 100}
ROOT_URLCONF: 'policies.urls'
SECRET_KEY: '********'
SECURE_BROWSER_XSS_FILTER: False
SECURE_CONTENT_TYPE_NOSNIFF: False
SECURE_HSTS_INCLUDE_SUBDOMAINS: False
SECURE_HSTS_PRELOAD: False
SECURE_HSTS_SECONDS: 0
SECURE_PROXY_SSL_HEADER: None
SECURE_REDIRECT_EXEMPT: []
SECURE_SSL_HOST: None
SECURE_SSL_REDIRECT: False
SERVER_EMAIL: 'root@localhost'
SERVICE_NAME: 'policies_panel'
SESSION_CACHE_ALIAS: 'default'
SESSION_COOKIE_AGE: 1209600
SESSION_COOKIE_DOMAIN: None
SESSION_COOKIE_HTTPONLY: True
SESSION_COOKIE_NAME: 'sessionid'
SESSION_COOKIE_PATH: '/'
SESSION_COOKIE_SECURE: False
SESSION_ENGINE: 'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE: False
SESSION_FILE_PATH: None
SESSION_SAVE_EVERY_REQUEST: False
SESSION_SERIALIZER: 'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE: 'policies.settings.defaults'
SHORT_DATETIME_FORMAT: 'm/d/Y P'
SHORT_DATE_FORMAT: 'm/d/Y'
SIGNING_BACKEND: 'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS: []
STATICFILES_DIRS:
('/Users/rohanjaswal/PycharmProjects/policies/frontend/build/static',
'/Users/rohanjaswal/PycharmProjects/policies/frontend/media')
STATICFILES_FINDERS: ['django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder']
STATICFILES_STORAGE: 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT: '/Users/rohanjaswal/PycharmProjects/policies/static'
STATIC_URL: '/static/'
TEMPLATES: [{'APP_DIRS': True,
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['/Users/rohanjaswal/PycharmProjects/policies/frontend/build'],
'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages']}}]
TEST_NON_SERIALIZED_APPS: []
TEST_RUNNER: 'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR: ','
TIME_FORMAT: 'P'
TIME_INPUT_FORMATS: ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE: 'UTC'
USER_INFO_AUDIT_TOPIC: 'audit-events'
USER_SERVICE_URL: 'http://userservice'
USER_TIME_ZONE: 'Asia/Jakarta'
USE_ETAGS: False
USE_I18N: True
USE_L10N: True
USE_THOUSAND_SEPARATOR: False
USE_TZ: True
USE_X_FORWARDED_HOST: False
USE_X_FORWARDED_PORT: False
WSGI_APPLICATION: 'policies.wsgi.application'
X_FRAME_OPTIONS: 'SAMEORIGIN'
YEAR_MONTH_FORMAT: 'F Y'
is_overridden: <bound method Settings.is_overridden of <Settings "policies.settings.defaults">>
BROKER_URL: 'redis://localhost:6379/10'
CELERY_DEFAULT_QUEUE: 'my_default_queue'

Steps to Reproduce

Required Dependencies

Minimal Python Version: 3.6.6

Minimal Celery Version: 4.2.1

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: N/A or Unknown

Minimal Result Backend Version: N/A or Unknown

Minimal OS and/or Kernel Version: N/A or Unknown

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

amqp==2.5.2
astroid==2.4.1
attrs==19.3.0
billiard==3.5.0.5
cachetools==4.0.0
celery==4.2.1
certifi==2019.11.28
chardet==3.0.4
coverage==5.0.3
Deprecated==1.2.9
Django==2.0.5
django-celery-beat==1.1.1
django-cors-headers==2.3.0
django-relativedelta==1.1.1
djangorestframework==3.8.2
djangorestframework-jwt==1.11.0
google-api-core==1.16.0
google-auth==1.11.2
google-cloud-core==0.28.1
google-cloud-logging==1.6.0
google-cloud-pubsub==0.41.0
google-cloud-storage==1.11.0
google-resumable-media==0.5.0
googleapis-common-protos==1.51.0
grpc-google-iam-v1==0.11.4
grpcio==1.9.1
gunicorn==19.9.0
idna==2.8
importlib-metadata==1.5.0
isort==4.3.21
kombu==4.6.3
lazy-object-proxy==1.4.3
mccabe==0.6.1
more-itertools==8.2.0
mysql-connector-python==8.0.11
newrelic==5.4.1.134
packaging==20.1
pluggy==0.13.1
protobuf==3.11.3
py==1.8.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
PyJWT==1.7.1
pylint==2.5.2
pyparsing==2.4.6
pytest==5.3.5
pytest-cov==2.8.1
pytest-django==3.8.0
python-dateutil==2.8.1
pytz==2019.3
raven==6.9.0
redis==3.3.11
requests==2.22.0
requests-file==1.4.3
requests-mock==1.7.0
rsa==4.0
six==1.14.0
slackclient==1.3.0
sqlparse==0.3.1
tldextract==2.2.2
toml==0.10.0
typed-ast==1.4.1
urllib3==1.25.8
uWSGI==2.0.17
vine==1.3.0
wcwidth==0.1.8
websocket-client==0.57.0
wrapt==1.12.1
zipp==3.0.0

Other Dependencies

N/A

Minimally Reproducible Test Case

Expected Behavior

In our system, we have a Pub-Sub subscriber client running which listens to messages and upon receiving a message, it triggers a celery task T(m) by passing the content of the message as an argument to the task.

Since, the subscriber client is single threaded, it means that tasks for messages will invoked in the order of messages received. For example, if I received m1, m2, m3, then my code will call T.delay(m1), T.delay(m2) and T.delay(m3) in the same order.

My celery worker is running with concurrency=2. So, let's name the 2 pool workers as p1 and p2

So, if I received 5 messages, let's say m1, m2, m3, m4, m5, the order of the receiving task as well as processing task should have been:

p2 - m1

p1 - m2

p2 - m3

p1 - m4

p2 - m5

Actual Behavior

What happened with me was, when I received 5 messages, let's say m1, m2, m3, m4, m5, they were processed in the order.

p2 - m5

p1 - m1

p2 - m3

p1 - m2

p2 - m4

Is there any celery configuration which could be triggering this behavior? And what can I do to avoid this. The order of these messages is important to our system.

Issue 2:
Checklist

I have checked the issues list

for similar or identical enhancement to an existing feature.

I have checked the pull requests list

for existing proposed enhancements.

I have checked the commit log

to find out if the if the same enhancement was already implemented in the

master branch.

I have included all related issues and possible duplicate issues in this issue

(If there are none, check this box anyway).

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Brief Summary

Rabbitmq supports verifying client's using a TLS keyfile. Celery supports this with one exception, the keyfile cannot be password

protected. I believe the underlying Python SSL library does support this so I am wondering if there is interest in adding that support

in Celery?

Design

Architectural Considerations

I believe Kombu would need updates as well as Celery.

Proposed Behavior

I propose adding a new element to the broker_use_ssl dict to provide the keyfile's password.

{"keyfile_password": "some strong password"}.

Proposed UI/UX

I believe only the broker_use_ssl setting would need updated from a UI standpoint.

Diagrams

N/A

Alternatives

The current feature works well, it just doesn't allow the keyfile to have a password. Therefore, a viable alternative is to

leave it the way it is.