Comments (9)
It cannot leave the message unacknowledged, as that means it will reduce the prefetch limit.
The only other way it could deal with it is to log the event and discard the message, as requeueing it will cause a loop.
from py-amqp.
@ask That works for me.
from py-amqp.
Correction! This bug is actually in amqp/serialization.py (separate project). The version I have (1.4.9) assumes all headers are UTF-8 encoded with this code:
def read_longstr(self):
"""Read a string that's up to 2**32 bytes.
The encoding isn't specified in the AMQP spec, so
assume it's utf-8
"""
self.bitcount = self.bits = 0
slen = unpack('>I', self.input.read(4))[0]
return self.input.read(slen).decode('utf-8')
But that is not a safe assumption, as header values are totally unconstrained. They could be binary data, for example.
Which is why the UnicodeDecodeError
is thrown. I see that the current amqp/serialization.py code is very different in master. Does the current code not have this limitation?
from py-amqp.
Here's a minimal snippet that can repro this crash and put your Celery worker into an unrecoverable loop:
my_task.apply_async(args=['test'], headers={'foo': '\x8d'})
The '\x8d
is not UTF-8, and thus when the worker tries to read the header table, it raise UnicodeDecodeError
, which will take down your Celery worker and prevent it from coming back up:
[2016-01-23 04:15:51,355: ERROR/MainProcess celery.worker] Unrecoverable error: UnicodeDecodeError('utf8', '\x8d', 0, 1, 'invalid start byte')
I would love to submit a PR to fix this, but I'm not super clear on what version of py-amqp to work on. What do you recommend?
Once I know which version to work on, I'm thinking about modifying the py-amqp serialization module to ignore header values that cannot be decoded with UTF-8.
from py-amqp.
Never mind, I found the 1.4 branch. Here's my PR: #78
from py-amqp.
Hi! I'm having the same issue with Celery 4.1.0 and kombu 4.1.0. Any idea?
from py-amqp.
can you cleanly apply the patch on pyamqp?
from py-amqp.
The bug is still present, it does not require a feedback but a simple fix...
from py-amqp.
could you tell which versions of celery you are using and facing this issue?
from py-amqp.
Related Issues (20)
- TCP_USER_TIMEOUT doesn't exist on solaris 11.4 HOT 2
- [BUG] Cannot set cert_reqs=ssl.CERT_NONE due to order of context modification in _wrap_socker_sni HOT 1
- Potentially broken _AbstractTransport.__repr__ HOT 4
- 5.0.6: sphinx warnings HOT 6
- 5.0.6: test suite is using `case` which uses `nose` (which is outdated) HOT 2
- Initial Update
- 5.0.7 SSL connection problem HOT 4
- Celery broken after release 5.0.8 HOT 6
- 5.1.1: pytest warnings HOT 2
- 'Server unexpectedly closed connection' HOT 6
- Waht is stable version? HOT 1
- amqp.exceptions.NotFound: Queue.declare: (404) NOT_FOUND
- pyamqp won't send heartbeat?
- 5.1.1: documentation build fails with sphinx 6.1.3 HOT 3
- Maximum recursion depth exceeded
- How does pyamqp/kombu make multiple threads share the same amqp connection? HOT 5
- bug: version 5.2.0 breaks celery with sqs msg processing HOT 3
- Client which use amqp lib always think that connection is blocked.
- Basic.publish: (406) PRECONDITION_FAILED - message size larger than configured max HOT 1
- create Virtual Hosts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-amqp.