我正在使用celery
和rabbitmq
,但是我最近得到了这个错误sock.setsockopt(SOL_TCP, opt, val), [Errno 22] Invalid argument
,
细节,
{1: 1, 2: 16396, 3: 0, 4: 60, 5: 10, 6: 9, 7: 0, 8: 30, 9: 0, 10: 81059, 12: 1}
(6, 1, 1)
(6, 2, 16396)
(6, 3, 0)
(6, 4, 60)
(6, 5, 10)
(6, 6, 9)
(6, 7, 0)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/celery/app/task.py", line 535, in apply_async
**options
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/celery/app/base.py", line 737, in send_task
amqp.send_task_message(P, name, message, **options)
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/celery/app/amqp.py", line 558, in send_task_message
**properties
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/messaging.py", line 181, in publish
exchange_name, declare,
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/connection.py", line 527, in _ensured
errback and errback(exc, 0)
File "/app/pyenv/versions/2.7.11/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/connection.py", line 419, in _reraise_as_library_errors
sys.exc_info()[2])
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/connection.py", line 414, in _reraise_as_library_errors
yield
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/connection.py", line 515, in _ensured
reraise_as_library_errors=False,
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/connection.py", line 405, in ensure_connection
callback)
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/utils/functional.py", line 333, in retry_over_time
return fun(*args, **kwargs)
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/connection.py", line 261, in connect
return self.connection
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/connection.py", line 802, in connection
self._connection = self._establish_connection()
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/connection.py", line 757, in _establish_connection
conn = self.transport.establish_connection()
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/kombu/transport/pyamqp.py", line 130, in establish_connection
conn.connect()
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/amqp/connection.py", line 294, in connect
self.transport.connect()
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/amqp/transport.py", line 122, in connect
self.socket_settings, self.read_timeout, self.write_timeout,
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/amqp/transport.py", line 174, in _init_socket
self._set_socket_options(socket_settings)
File "/app/pyenv/versions/2.7.11/lib/python2.7/site-packages/amqp/transport.py", line 205, in _set_socket_options
self.sock.setsockopt(SOL_TCP, opt, val)
File "/app/pyenv/versions/2.7.11/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
kombu.exceptions.OperationalError: [Errno 22] Invalid argument
(6, 7, 0)
是我在_set_socket_options
中添加的print(SOL_TCP, opt, val)
的输出
参考_socket.pi
后,我得到这个:
6
,SOL_TCP = 6
7
,TCP_SYNCNT = 7
(我认为...0
, 瓦尔
据我所知,我假设它具有系统设置,它与具有相同代码和包的其他系统配合良好。但我对TCP_SYNCNT
知之甚少,任何帮助都值得赞赏!
顺便说一句,这是我的环境
- 芹菜 4.0.2 (潜伏(
- Rabbitmq-server-3.6.6-1.el6.noarch
- 二郎-19.1.6-1.el6.x86_64
- CentOS 版本 6.4 (最终版(
- python2.7.11 with pyenv
点冻结
amqp==2.1.4
billiard==3.5.0.2
celery==4.0.2
chardet==3.0.4
Django==1.10.3
django-redis==4.8.0
djangorestframework==3.6.3
httplib2==0.10.3
kombu==4.0.2
netifaces==0.10.6
psutil==5.2.2
py==1.4.34
pyasn1==0.2.3
pyftpdlib==1.5.2
pyrabbit==1.1.0
pytest==3.0.6
pytz==2017.2
redis==2.10.5
rsa==3.4.2
six==1.10.0
vine==1.1.3
xlrd==1.0.0
通过集合net.ipv4.tcp_syn_retries = 1
解决,有人将其设置为0
这可能意味着在ESTABLISHED
之前永远不会发送syn
。