Skip to content

Refs #4356: Handle "hybrid" messages that have moved between Celery versions - #4358

Merged
thedrow merged 6 commits into
celery:masterfrom
zapier:v4.1.x
Jan 12, 2018
Merged

thedrow merged 6 commits into
celery:masterfrom
zapier:v4.1.x

Conversation

@freakboy3742

Copy link
Copy Markdown
Contributor

The patch in #4357 addresses a problem with forward compatibility in message handling. This

If you apply the patch from #4357, then modify the test case reported in #4356 to cycle from Celery 3.1 -> 4.1 -> 3.1 -> 4.1, you get a similar error, but on the Celery 4.1 worker:

Traceback (most recent call last):
  File "/Users/rkm/zapier/celery/celery4-venv/lib/python2.7/site-packages/billiard/pool.py", line 1747, in safe_apply_callback
    fun(*args, **kwargs)
  File "/Users/rkm/zapier/celery/celery4-venv/lib/python2.7/site-packages/celery/worker/request.py", line 366, in on_failure
    self.id, exc, request=self, store_result=self.store_errors,
  File "/Users/rkm/zapier/celery/celery4-venv/lib/python2.7/site-packages/celery/backends/base.py", line 165, in mark_as_failure
    if request.chord:
  File "/Users/rkm/zapier/celery/celery4-venv/lib/python2.7/site-packages/kombu/utils/objects.py", line 44, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/Users/rkm/zapier/celery/celery4-venv/lib/python2.7/site-packages/celery/worker/request.py", line 485, in chord
    _, _, embed = self._payload
ValueError: too many values to unpack

This patch handles the "hybrid" syntax on the Celery 4.1 worker.

…rotocol 2 consumer in its life.

we detected an edgecase which is proofed out in https://gist.github.com/ewdurbin/ddf4b0f0c0a4b190251a4a23859dd13c#file-readme-md which mishandles messages which have been retried by a 3.1.25, then a 4.1.0, then again by a 3.1.25 consumer. as an extension, this patch handles the "next" iteration of these mutant payloads.
@thedrow

thedrow commented Nov 8, 2017

Copy link
Copy Markdown
Contributor

I think that in this case a unit test that verifies that we can move a message between protocol v1 and v2 after a retry is enough to validate this.
The unit test should just test the flows of translating a v1 message to v2 message and a v2 message to v1 message.

@thedrow

thedrow commented Dec 12, 2017

Copy link
Copy Markdown
Contributor

@freakboy3742 any chance you'll get to write that unit test?
We would like to have this fixed released in 4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants