From 4fef378601d58630a4280360b7a54d74f76e895e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Sat, 4 Jan 2020 19:29:38 +0100 Subject: [PATCH] version update + docs changes --- LICENSE | 4 +- README.md | 43 +++- compile_definitions/__main__.py | 2 +- coolamqp/__init__.py | 2 +- coolamqp/framing/definitions.py | 360 ++++++++++++++++---------------- docs/casefile-0001 | 80 ------- docs/caveats.rst | 5 +- docs/conf.py | 10 +- 8 files changed, 226 insertions(+), 280 deletions(-) delete mode 100644 docs/casefile-0001 diff --git a/LICENSE b/LICENSE index 2de3c57..3714ac1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ The MIT License (MIT) -Copyright (c) 2016-2018 DMS Serwis s.c. -Copyright (c) 2018-2020 SMOK sp. z o.o. +Copyright (c) 2016-2018 DMS Serwis s. c. +Copyright (c) 2018-2020 SMOK sp. z o. o. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 275b44c..ef54832 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ CoolAMQP [](http://coolamqp.readthedocs.io/en/latest/?badge=develop) []() -A **magical** AMQP client, that uses **heavy sorcery** to achieve speeds that other AMQP clients cannot even hope to match. +A **magical** AMQP 0.9.1 client, that uses **heavy sorcery** to achieve speeds that other AMQP clients cannot even hope to match. Documentation (WIP) is available at [Read the Docs](http://coolamqp.readthedocs.io/). @@ -57,11 +57,40 @@ IP of previous operator of the service, DMS Serwis s.c., which continues to operate within it's designated company agreement. From there stems the copyright holder name change. -## Compiling definitions.py +## What is here -Make sure that you have `yapf` installed, then perform: -```python -python -m compile_definitions -``` +### [coolamqp](coolamqp/) + +The core module + +### [stress_tests](stress_tests/) + +A series of stress tests to catch any race conditions + +### [tests](tests/) + +A series of unit tests that need an AMQP server listening. + +### [compile_definitions](compile_definitions/) + +A tool to generate [definitions.py](coolamqp/framing/definitions.py) +from [amqp-0-9-1.xml](resources/amqp0-9-1.xml) + +In order to compile the definitions: + +* Make sure that you have `yapf` installed +* then perform: + ```python + python -m compile_definitions + ``` and you're all set. The only files modified is -[definitions.py](coolamqp/framing/definitions.py). \ No newline at end of file +[definitions.py](coolamqp/framing/definitions.py). + +### [resources](resources/) + +A downloaded from OASIS machine-readable AMQP 0.9.1 specification. + +### [docs](docs/) + +Sources for the documentation, available +[here](https://coolamqp.readthedocs.io/en/latest/). \ No newline at end of file diff --git a/compile_definitions/__main__.py b/compile_definitions/__main__.py index 5cd9166..c4226af 100644 --- a/compile_definitions/__main__.py +++ b/compile_definitions/__main__.py @@ -39,7 +39,7 @@ from __future__ import print_function, absolute_import A Python version of the AMQP machine-readable specification. Generated automatically by CoolAMQP from AMQP machine-readable specification. -See coolamqp.uplink.framing.compilation for the tool +See compile_definitions for the tool AMQP is copyright (c) 2016 OASIS CoolAMQP is copyright (c) 2016-2018 DMS Serwis s.c., 2018-2020 SMOK sp. z o.o. diff --git a/coolamqp/__init__.py b/coolamqp/__init__.py index 95c6447..ebd3768 100644 --- a/coolamqp/__init__.py +++ b/coolamqp/__init__.py @@ -1,2 +1,2 @@ # coding=UTF-8 -__version__ = '0.100a1' +__version__ = '0.101a2' diff --git a/coolamqp/framing/definitions.py b/coolamqp/framing/definitions.py index cb5911b..6fbccd8 100644 --- a/coolamqp/framing/definitions.py +++ b/coolamqp/framing/definitions.py @@ -4,7 +4,7 @@ from __future__ import print_function, absolute_import A Python version of the AMQP machine-readable specification. Generated automatically by CoolAMQP from AMQP machine-readable specification. -See coolamqp.uplink.framing.compilation for the tool +See compile_definitions for the tool AMQP is copyright (c) 2016 OASIS CoolAMQP is copyright (c) 2016-2018 DMS Serwis s.c., 2018-2020 SMOK sp. z o.o. @@ -152,15 +152,15 @@ NOT_IMPLEMENTED = 540 # normal operations. INTERNAL_ERROR = 541 +SOFT_ERRORS = [ + CONTENT_TOO_LARGE, NO_CONSUMERS, ACCESS_REFUSED, NOT_FOUND, + RESOURCE_LOCKED, PRECONDITION_FAILED +] HARD_ERRORS = [ CONNECTION_FORCED, INVALID_PATH, FRAME_ERROR, SYNTAX_ERROR, COMMAND_INVALID, CHANNEL_ERROR, UNEXPECTED_FRAME, RESOURCE_ERROR, NOT_ALLOWED, NOT_IMPLEMENTED, INTERNAL_ERROR ] -SOFT_ERRORS = [ - CONTENT_TOO_LARGE, NO_CONSUMERS, ACCESS_REFUSED, NOT_FOUND, - RESOURCE_LOCKED, PRECONDITION_FAILED -] DOMAIN_TO_BASIC_TYPE = { u'class-id': u'short', @@ -1082,7 +1082,7 @@ class ConnectionUnblocked(AMQPMethodPayload): @classmethod def from_buffer( - cls, buf, start_offset): # type: (buffer, int) -> ConnectionUnblocked + cls, buf, start_offset): # type: (buffer, int) -> ConnectionUnblocked offset = start_offset return cls() @@ -3050,7 +3050,7 @@ class BasicContentPropertyList(AMQPContentPropertyList): while buf[offset + pfl - 1] & 1: pfl += 2 zpf = BasicContentPropertyList.zero_property_flags(buf[offset:offset + - pfl]).tobytes() + pfl]).tobytes() if zpf in BasicContentPropertyList.PARTICULAR_CLASSES: return BasicContentPropertyList.PARTICULAR_CLASSES[ zpf].from_buffer(buf, offset) @@ -4888,133 +4888,133 @@ class ConfirmSelectOk(AMQPMethodPayload): IDENT_TO_METHOD = { - (90, 21): TxCommitOk, - (60, 100): BasicRecoverAsync, + (10, 60): ConnectionBlocked, + (10, 50): ConnectionClose, + (10, 51): ConnectionCloseOk, + (10, 40): ConnectionOpen, + (10, 41): ConnectionOpenOk, + (10, 10): ConnectionStart, + (10, 20): ConnectionSecure, (10, 11): ConnectionStartOk, - (60, 40): BasicPublish, - (60, 50): BasicReturn, - (40, 21): ExchangeDeleteOk, - (20, 20): ChannelFlow, - (40, 31): ExchangeBindOk, - (60, 21): BasicConsumeOk, (10, 21): ConnectionSecureOk, - (90, 30): TxRollback, - (90, 10): TxSelect, - (85, 11): ConfirmSelectOk, - (10, 61): ConnectionUnblocked, - (50, 11): QueueDeclareOk, - (60, 70): BasicGet, - (90, 11): TxSelectOk, (10, 30): ConnectionTune, - (60, 11): BasicQosOk, - (60, 80): BasicAck, - (20, 21): ChannelFlowOk, - (60, 60): BasicDeliver, - (90, 31): TxRollbackOk, - (60, 20): BasicConsume, - (85, 10): ConfirmSelect, - (20, 40): ChannelClose, - (60, 71): BasicGetOk, - (50, 30): QueuePurge, (10, 31): ConnectionTuneOk, - (10, 40): ConnectionOpen, - (60, 30): BasicCancel, - (50, 50): QueueUnbind, - (40, 10): ExchangeDeclare, - (10, 50): ConnectionClose, - (20, 10): ChannelOpen, + (10, 61): ConnectionUnblocked, + (20, 40): ChannelClose, (20, 41): ChannelCloseOk, - (60, 110): BasicRecover, - (60, 90): BasicReject, - (50, 31): QueuePurgeOk, - (50, 40): QueueDelete, - (40, 20): ExchangeDelete, - (50, 20): QueueBind, - (10, 41): ConnectionOpenOk, - (60, 120): BasicNack, - (60, 31): BasicCancelOk, - (90, 20): TxCommit, - (10, 10): ConnectionStart, - (60, 10): BasicQos, - (40, 11): ExchangeDeclareOk, - (10, 51): ConnectionCloseOk, - (40, 51): ExchangeUnbindOk, + (20, 20): ChannelFlow, + (20, 21): ChannelFlowOk, + (20, 10): ChannelOpen, (20, 11): ChannelOpenOk, - (60, 72): BasicGetEmpty, (40, 30): ExchangeBind, - (60, 111): BasicRecoverOk, + (40, 31): ExchangeBindOk, + (40, 10): ExchangeDeclare, + (40, 20): ExchangeDelete, + (40, 11): ExchangeDeclareOk, + (40, 21): ExchangeDeleteOk, (40, 40): ExchangeUnbind, - (10, 20): ConnectionSecure, - (50, 41): QueueDeleteOk, - (50, 51): QueueUnbindOk, + (40, 51): ExchangeUnbindOk, + (50, 20): QueueBind, (50, 21): QueueBindOk, - (10, 60): ConnectionBlocked, (50, 10): QueueDeclare, + (50, 40): QueueDelete, + (50, 11): QueueDeclareOk, + (50, 41): QueueDeleteOk, + (50, 30): QueuePurge, + (50, 31): QueuePurgeOk, + (50, 50): QueueUnbind, + (50, 51): QueueUnbindOk, + (60, 80): BasicAck, + (60, 20): BasicConsume, + (60, 30): BasicCancel, + (60, 21): BasicConsumeOk, + (60, 31): BasicCancelOk, + (60, 60): BasicDeliver, + (60, 70): BasicGet, + (60, 71): BasicGetOk, + (60, 72): BasicGetEmpty, + (60, 120): BasicNack, + (60, 40): BasicPublish, + (60, 10): BasicQos, + (60, 11): BasicQosOk, + (60, 50): BasicReturn, + (60, 90): BasicReject, + (60, 100): BasicRecoverAsync, + (60, 110): BasicRecover, + (60, 111): BasicRecoverOk, + (90, 20): TxCommit, + (90, 21): TxCommitOk, + (90, 30): TxRollback, + (90, 31): TxRollbackOk, + (90, 10): TxSelect, + (90, 11): TxSelectOk, + (85, 10): ConfirmSelect, + (85, 11): ConfirmSelectOk, } BINARY_HEADER_TO_METHOD = { - b'\x00\x5A\x00\x15': TxCommitOk, - b'\x00\x3C\x00\x64': BasicRecoverAsync, + b'\x00\x0A\x00\x3C': ConnectionBlocked, + b'\x00\x0A\x00\x32': ConnectionClose, + b'\x00\x0A\x00\x33': ConnectionCloseOk, + b'\x00\x0A\x00\x28': ConnectionOpen, + b'\x00\x0A\x00\x29': ConnectionOpenOk, + b'\x00\x0A\x00\x0A': ConnectionStart, + b'\x00\x0A\x00\x14': ConnectionSecure, b'\x00\x0A\x00\x0B': ConnectionStartOk, - b'\x00\x3C\x00\x28': BasicPublish, - b'\x00\x3C\x00\x32': BasicReturn, - b'\x00\x28\x00\x15': ExchangeDeleteOk, - b'\x00\x14\x00\x14': ChannelFlow, - b'\x00\x28\x00\x1F': ExchangeBindOk, - b'\x00\x3C\x00\x15': BasicConsumeOk, b'\x00\x0A\x00\x15': ConnectionSecureOk, - b'\x00\x5A\x00\x1E': TxRollback, - b'\x00\x5A\x00\x0A': TxSelect, - b'\x00\x55\x00\x0B': ConfirmSelectOk, - b'\x00\x0A\x00\x3D': ConnectionUnblocked, - b'\x00\x32\x00\x0B': QueueDeclareOk, - b'\x00\x3C\x00\x46': BasicGet, - b'\x00\x5A\x00\x0B': TxSelectOk, b'\x00\x0A\x00\x1E': ConnectionTune, - b'\x00\x3C\x00\x0B': BasicQosOk, - b'\x00\x3C\x00\x50': BasicAck, - b'\x00\x14\x00\x15': ChannelFlowOk, - b'\x00\x3C\x00\x3C': BasicDeliver, - b'\x00\x5A\x00\x1F': TxRollbackOk, - b'\x00\x3C\x00\x14': BasicConsume, - b'\x00\x55\x00\x0A': ConfirmSelect, - b'\x00\x14\x00\x28': ChannelClose, - b'\x00\x3C\x00\x47': BasicGetOk, - b'\x00\x32\x00\x1E': QueuePurge, b'\x00\x0A\x00\x1F': ConnectionTuneOk, - b'\x00\x0A\x00\x28': ConnectionOpen, - b'\x00\x3C\x00\x1E': BasicCancel, - b'\x00\x32\x00\x32': QueueUnbind, - b'\x00\x28\x00\x0A': ExchangeDeclare, - b'\x00\x0A\x00\x32': ConnectionClose, - b'\x00\x14\x00\x0A': ChannelOpen, + b'\x00\x0A\x00\x3D': ConnectionUnblocked, + b'\x00\x14\x00\x28': ChannelClose, b'\x00\x14\x00\x29': ChannelCloseOk, - b'\x00\x3C\x00\x6E': BasicRecover, - b'\x00\x3C\x00\x5A': BasicReject, - b'\x00\x32\x00\x1F': QueuePurgeOk, - b'\x00\x32\x00\x28': QueueDelete, - b'\x00\x28\x00\x14': ExchangeDelete, - b'\x00\x32\x00\x14': QueueBind, - b'\x00\x0A\x00\x29': ConnectionOpenOk, - b'\x00\x3C\x00\x78': BasicNack, - b'\x00\x3C\x00\x1F': BasicCancelOk, - b'\x00\x5A\x00\x14': TxCommit, - b'\x00\x0A\x00\x0A': ConnectionStart, - b'\x00\x3C\x00\x0A': BasicQos, - b'\x00\x28\x00\x0B': ExchangeDeclareOk, - b'\x00\x0A\x00\x33': ConnectionCloseOk, - b'\x00\x28\x00\x33': ExchangeUnbindOk, + b'\x00\x14\x00\x14': ChannelFlow, + b'\x00\x14\x00\x15': ChannelFlowOk, + b'\x00\x14\x00\x0A': ChannelOpen, b'\x00\x14\x00\x0B': ChannelOpenOk, - b'\x00\x3C\x00\x48': BasicGetEmpty, b'\x00\x28\x00\x1E': ExchangeBind, - b'\x00\x3C\x00\x6F': BasicRecoverOk, + b'\x00\x28\x00\x1F': ExchangeBindOk, + b'\x00\x28\x00\x0A': ExchangeDeclare, + b'\x00\x28\x00\x14': ExchangeDelete, + b'\x00\x28\x00\x0B': ExchangeDeclareOk, + b'\x00\x28\x00\x15': ExchangeDeleteOk, b'\x00\x28\x00\x28': ExchangeUnbind, - b'\x00\x0A\x00\x14': ConnectionSecure, - b'\x00\x32\x00\x29': QueueDeleteOk, - b'\x00\x32\x00\x33': QueueUnbindOk, + b'\x00\x28\x00\x33': ExchangeUnbindOk, + b'\x00\x32\x00\x14': QueueBind, b'\x00\x32\x00\x15': QueueBindOk, - b'\x00\x0A\x00\x3C': ConnectionBlocked, b'\x00\x32\x00\x0A': QueueDeclare, + b'\x00\x32\x00\x28': QueueDelete, + b'\x00\x32\x00\x0B': QueueDeclareOk, + b'\x00\x32\x00\x29': QueueDeleteOk, + b'\x00\x32\x00\x1E': QueuePurge, + b'\x00\x32\x00\x1F': QueuePurgeOk, + b'\x00\x32\x00\x32': QueueUnbind, + b'\x00\x32\x00\x33': QueueUnbindOk, + b'\x00\x3C\x00\x50': BasicAck, + b'\x00\x3C\x00\x14': BasicConsume, + b'\x00\x3C\x00\x1E': BasicCancel, + b'\x00\x3C\x00\x15': BasicConsumeOk, + b'\x00\x3C\x00\x1F': BasicCancelOk, + b'\x00\x3C\x00\x3C': BasicDeliver, + b'\x00\x3C\x00\x46': BasicGet, + b'\x00\x3C\x00\x47': BasicGetOk, + b'\x00\x3C\x00\x48': BasicGetEmpty, + b'\x00\x3C\x00\x78': BasicNack, + b'\x00\x3C\x00\x28': BasicPublish, + b'\x00\x3C\x00\x0A': BasicQos, + b'\x00\x3C\x00\x0B': BasicQosOk, + b'\x00\x3C\x00\x32': BasicReturn, + b'\x00\x3C\x00\x5A': BasicReject, + b'\x00\x3C\x00\x64': BasicRecoverAsync, + b'\x00\x3C\x00\x6E': BasicRecover, + b'\x00\x3C\x00\x6F': BasicRecoverOk, + b'\x00\x5A\x00\x14': TxCommit, + b'\x00\x5A\x00\x15': TxCommitOk, + b'\x00\x5A\x00\x1E': TxRollback, + b'\x00\x5A\x00\x1F': TxRollbackOk, + b'\x00\x5A\x00\x0A': TxSelect, + b'\x00\x5A\x00\x0B': TxSelectOk, + b'\x00\x55\x00\x0A': ConfirmSelect, + b'\x00\x55\x00\x0B': ConfirmSelectOk, } CLASS_ID_TO_CONTENT_PROPERTY_LIST = { @@ -5025,98 +5025,98 @@ CLASS_ID_TO_CONTENT_PROPERTY_LIST = { # if a method is NOT a reply, it will not be in this dict # a method may be a reply for AT MOST one method REPLY_REASONS_FOR = { - BasicGetEmpty: BasicGet, - BasicGetOk: BasicGet, + ConnectionCloseOk: ConnectionClose, + ConnectionOpenOk: ConnectionOpen, + ConnectionStartOk: ConnectionStart, + ConnectionSecureOk: ConnectionSecure, + ConnectionTuneOk: ConnectionTune, + ChannelCloseOk: ChannelClose, + ChannelFlowOk: ChannelFlow, + ChannelOpenOk: ChannelOpen, + ExchangeBindOk: ExchangeBind, + ExchangeDeclareOk: ExchangeDeclare, ExchangeDeleteOk: ExchangeDelete, - TxSelectOk: TxSelect, + ExchangeUnbindOk: ExchangeUnbind, QueueBindOk: QueueBind, + QueueDeclareOk: QueueDeclare, + QueueDeleteOk: QueueDelete, + QueuePurgeOk: QueuePurge, + QueueUnbindOk: QueueUnbind, BasicConsumeOk: BasicConsume, BasicCancelOk: BasicCancel, - TxRollbackOk: TxRollback, - TxCommitOk: TxCommit, - ChannelOpenOk: ChannelOpen, - QueueDeleteOk: QueueDelete, - ExchangeUnbindOk: ExchangeUnbind, - ExchangeBindOk: ExchangeBind, - ChannelCloseOk: ChannelClose, + BasicGetOk: BasicGet, + BasicGetEmpty: BasicGet, BasicQosOk: BasicQos, - ConnectionStartOk: ConnectionStart, - QueueUnbindOk: QueueUnbind, + TxCommitOk: TxCommit, + TxRollbackOk: TxRollback, + TxSelectOk: TxSelect, ConfirmSelectOk: ConfirmSelect, - ConnectionCloseOk: ConnectionClose, - QueuePurgeOk: QueuePurge, - QueueDeclareOk: QueueDeclare, - ExchangeDeclareOk: ExchangeDeclare, - ConnectionTuneOk: ConnectionTune, - ConnectionSecureOk: ConnectionSecure, - ConnectionOpenOk: ConnectionOpen, - ChannelFlowOk: ChannelFlow, } # Methods that are replies for other, ie. ConnectionOpenOk: ConnectionOpen # a method may be a reply for ONE or NONE other methods # if a method has no replies, it will have an empty list as value here REPLIES_FOR = { - BasicGetEmpty: [], - BasicRecoverOk: [], - BasicReturn: [], - QueueDeclare: [QueueDeclareOk], - BasicGetOk: [], + ConnectionBlocked: [], + ConnectionClose: [ConnectionCloseOk], + ConnectionCloseOk: [], + ConnectionOpen: [ConnectionOpenOk], + ConnectionOpenOk: [], + ConnectionStart: [ConnectionStartOk], ConnectionSecure: [ConnectionSecureOk], + ConnectionStartOk: [], + ConnectionSecureOk: [], ConnectionTune: [ConnectionTuneOk], - TxRollback: [TxRollbackOk], - TxSelectOk: [], - QueueBindOk: [], + ConnectionTuneOk: [], + ConnectionUnblocked: [], + ChannelClose: [ChannelCloseOk], + ChannelCloseOk: [], ChannelFlow: [ChannelFlowOk], - BasicConsumeOk: [], - BasicConsume: [BasicConsumeOk], - BasicRecover: [], - BasicCancelOk: [], - ConfirmSelect: [ConfirmSelectOk], - BasicGet: [BasicGetOk, BasicGetEmpty], - TxRollbackOk: [], - QueueBind: [QueueBindOk], - ExchangeDelete: [ExchangeDeleteOk], - BasicAck: [], - ConnectionClose: [ConnectionCloseOk], + ChannelFlowOk: [], + ChannelOpen: [ChannelOpenOk], ChannelOpenOk: [], - QueueDeleteOk: [], - ExchangeUnbindOk: [], - ConnectionStart: [ConnectionStartOk], - BasicQos: [BasicQosOk], - QueueUnbind: [QueueUnbindOk], - BasicQosOk: [], - BasicReject: [], + ExchangeBind: [ExchangeBindOk], ExchangeBindOk: [], - ChannelCloseOk: [], ExchangeDeclare: [ExchangeDeclareOk], - ConnectionBlocked: [], - BasicPublish: [], - ExchangeUnbind: [ExchangeUnbindOk], + ExchangeDelete: [ExchangeDeleteOk], + ExchangeDeclareOk: [], ExchangeDeleteOk: [], - BasicNack: [], - ConnectionStartOk: [], - ExchangeBind: [ExchangeBindOk], + ExchangeUnbind: [ExchangeUnbindOk], + ExchangeUnbindOk: [], + QueueBind: [QueueBindOk], + QueueBindOk: [], + QueueDeclare: [QueueDeclareOk], QueueDelete: [QueueDeleteOk], - ConfirmSelectOk: [], - ConnectionCloseOk: [], + QueueDeclareOk: [], + QueueDeleteOk: [], QueuePurge: [QueuePurgeOk], - QueueUnbindOk: [], - ChannelOpen: [ChannelOpenOk], - ChannelClose: [ChannelCloseOk], QueuePurgeOk: [], - QueueDeclareOk: [], + QueueUnbind: [QueueUnbindOk], + QueueUnbindOk: [], + BasicAck: [], + BasicConsume: [BasicConsumeOk], BasicCancel: [BasicCancelOk], - ExchangeDeclareOk: [], - TxCommitOk: [], - ConnectionTuneOk: [], - ConnectionSecureOk: [], - ConnectionUnblocked: [], - ConnectionOpenOk: [], - ChannelFlowOk: [], - BasicRecoverAsync: [], - TxSelect: [TxSelectOk], + BasicConsumeOk: [], + BasicCancelOk: [], BasicDeliver: [], + BasicGet: [BasicGetOk, BasicGetEmpty], + BasicGetOk: [], + BasicGetEmpty: [], + BasicNack: [], + BasicPublish: [], + BasicQos: [BasicQosOk], + BasicQosOk: [], + BasicReturn: [], + BasicReject: [], + BasicRecoverAsync: [], + BasicRecover: [], + BasicRecoverOk: [], TxCommit: [TxCommitOk], - ConnectionOpen: [ConnectionOpenOk], + TxCommitOk: [], + TxRollback: [TxRollbackOk], + TxRollbackOk: [], + TxSelect: [TxSelectOk], + TxSelectOk: [], + ConfirmSelect: [ConfirmSelectOk], + ConfirmSelectOk: [], } diff --git a/docs/casefile-0001 b/docs/casefile-0001 deleted file mode 100644 index fae950f..0000000 --- a/docs/casefile-0001 +++ /dev/null @@ -1,80 +0,0 @@ -Exception caught on 2017-02-25T20:29:08.025256: -Traceback (most recent call last): - File "/smok4/src/sai/basic/__init__.py", line 71, in run_with_except_hook - run_old(*args, **kw) - File "/smok4/src/vesta/initiator/__init__.py", line 221, in run - log(**contents) - File "/smok4/src/sai/basic/logmaker/__init__.py", line 34, in log - handle.options(tx=False)(kwargs) - File "/usr/local/lib/python2.7/dist-packages/loveseal/task.py", line 139, in roll - r = self.region.amqp.publish(msg, routing_key=self.region.deadletter_queue, tx=True) - File "/smok4/src/sai/basic/msgs.py", line 83, in publish - return super(_AMQP, self).publish(msg, exchange, routing_key, tx) - File "/usr/local/lib/python2.7/dist-packages/coolamqp/clustering/cluster.py", line 145, in publish - return (self.pub_tr if tx else self.pub_na).publish(message, exchange, routing_key) - File "/usr/local/lib/python2.7/dist-packages/coolamqp/attaches/utils.py", line 230, in monitored - return fun(*args, **kwargs) - File "/usr/local/lib/python2.7/dist-packages/coolamqp/attaches/publisher.py", line 214, in publish - self._mode_cnpub_process_deliveries() - File "/usr/local/lib/python2.7/dist-packages/coolamqp/attaches/publisher.py", line 148, in _mode_cnpub_process_deliveries - msg, xchg, rk, fut = self.messages.popleft() -IndexError: pop from an empty deque - -* Stack trace, innermost first -** _mode_cnpub_process_deliveries at /usr/local/lib/python2.7/dist-packages/coolamqp/attaches/publisher.py:148 -*** self: <coolamqp.attaches.publisher.Publisher object at 0x7f6267dca810> -** publish at /usr/local/lib/python2.7/dist-packages/coolamqp/attaches/publisher.py:214 -*** fut: <Future at 0x7f623eeab2d0 state=running> -*** cnpo: CnpubMessageSendOrder(message=<coolamqp.objects.Message object at 0x7f623eeabdd0>, exchange_name='', routing_key='loveseal-deadletter', future=<Future at 0x7f623eeab2d0 state=running>) -*** exchange: '' -*** self: <coolamqp.attaches.publisher.Publisher object at 0x7f6267dca810> -*** routing_key: 'loveseal-deadletter' -*** message: <coolamqp.objects.Message object at 0x7f623eeabdd0> -** monitored at /usr/local/lib/python2.7/dist-packages/coolamqp/attaches/utils.py:230 -*** fun: <function publish at 0x7f626aaea578> -*** args: (<coolamqp.attaches.publisher.Publisher object at 0x7f6267dca810>, <coolamqp.objects.Message object at 0x7f623eeabdd0>, '', 'loveseal-deadletter') -*** kwargs: {} -** publish at /usr/local/lib/python2.7/dist-packages/coolamqp/clustering/cluster.py:147 -*** tx: True -*** confirm: None -*** self: <sai.basic.msgs._AMQP object at 0x7f626a841190> -*** exchange: '' -*** routing_key: 'loveseal-deadletter' -*** message: <coolamqp.objects.Message object at 0x7f623eeabdd0> -** publish at /smok4/src/sai/basic/msgs.py:83 -*** tx: True -*** exchange: '' -*** self: <sai.basic.msgs._AMQP object at 0x7f626a841190> -*** routing_key: 'loveseal-deadletter' -*** content: <coolamqp.objects.Message object at 0x7f623eeabdd0> -*** msg: <coolamqp.objects.Message object at 0x7f623eeabdd0> -** roll at /usr/local/lib/python2.7/dist-packages/loveseal/task.py:139 -*** body: '\x80\x02}q\x01(U\x06regionq\x02U\nsmok4-coreq\x03U\x04argsq\x04}q\x05(U\x0cping_profileq\x06K\x00U\x0benc_profileq\x07K\x01U\x07journalq\x08U\rsecurity/ssspq\tU\x05labelq\nU\x11sssp.secexceptionq\x0bU\x07sssp_idq\x0cJ\x01\x00\x17\x01U\ttimestampq\rGA\xd6,v\xc0\xfe\xb75U\x07messageq\x0eU\x1aSSSP device does not existq\x0fU\x06loggerq\x10U\x0evesta2408@dev1U\tremote_ipq\x11U\x10172.17.0.1:35779q\x12u\x85q\x13U\x02idq\x14U 4743bd5a817d4c23baaf3fe25b8aa4f0q\x15U\x04nameq\x16U\x1esai.basic.logmaker.lvsl.handleq\x17u.' -*** job_id: '4743bd5a817d4c23baaf3fe25b8aa4f0' -*** tx: False -*** opt_kwargs: {'tx': False} -*** self: <loveseal.task.Task object at 0x7f623ff03750> -*** args: ({'ping_profile': 0, 'enc_profile': 1, 'journal': 'security/sssp', 'label': 'sssp.secexception', 'sssp_id': 18284545, 'timestamp': 1488050947.979932, 'message': 'SSSP device does not exist', 'logger': 'vesta2408@dev1', 'remote_ip': '172.17.0.1:35779'},) -*** job: <loveseal.region.job.NormalJob object at 0x7f623ff12850> -*** job_to_dict: <function job_to_dict at 0x7f623ff20410> -*** NormalJob: <class 'loveseal.region.job.NormalJob'> -*** kwargs: {} -*** msg: <coolamqp.objects.Message object at 0x7f623eeabdd0> -*** props: <coolamqp.framing.compilation.content_property.ParticularContentTypeList object at 0x7f6267cd31b8> -** log at /smok4/src/sai/basic/logmaker/__init__.py:34 -*** Configuration: <class 'sai.basic.config.Configuration'> -*** handle: <loveseal.task.Task object at 0x7f623ff03750> -*** kwargs: {'ping_profile': 0, 'enc_profile': 1, 'journal': 'security/sssp', 'label': 'sssp.secexception', 'sssp_id': 18284545, 'timestamp': 1488050947.979932, 'message': 'SSSP device does not exist', 'logger': 'vesta2408@dev1', 'remote_ip': '172.17.0.1:35779'} -** run at /smok4/src/vesta/initiator/__init__.py:221 -*** self: <SSSPInitiator(Thread-19, started 140060586936064)> -*** e: SecException() -*** contents: {'sssp_id': 18284545, 'ping_profile': 0, 'enc_profile': 1, 'message': 'SSSP device does not exist', 'label': 'sssp.secexception', 'journal': 'security/sssp', 'remote_ip': '172.17.0.1:35779'} -** run_with_except_hook at /smok4/src/sai/basic/__init__.py:73 -*** args: () -*** kw: {} -*** run_old: <bound method SSSPInitiator.run of <SSSPInitiator(Thread-19, started 140060586936064)>> -** __bootstrap_inner at /usr/lib/python2.7/threading.py:810 -*** self: <SSSPInitiator(Thread-19, started 140060586936064)> -** __bootstrap at /usr/lib/python2.7/threading.py:783 -*** self: <SSSPInitiator(Thread-19, started 140060586936064)> -************************************************* diff --git a/docs/caveats.rst b/docs/caveats.rst index 6583962..7761bdd 100644 --- a/docs/caveats.rst +++ b/docs/caveats.rst @@ -6,7 +6,7 @@ Things to look out for memoryviews ----------- -Since CoolAMQP tries to be fast, it uses memoryviews everywhere. _ReceivedMessage_ properties, and message +Since CoolAMQP tries to be fast, it uses memoryviews everywhere. **ReceivedMessage** properties, and message properties therefore, are memoryviews. So, it you wanted to read the routing key a message was sent with, or message's encoding, you should do: @@ -20,7 +20,8 @@ Only the **body** property of the message will be a byte object (and not even th Note that YOU, when sending messages, should not use memoryviews. Pass proper byte objects and text objects as required. -**AMQPError**'s returned to you via futures will also have memoryviews as **reply_text**! +**AMQPError**'s returned to you via futures will also have memoryviews as **reply_text**, although they will +properly display that once __repr__ or __str__ is called on them. It was considered whether to unserialize short fields, such as **routing_key** or **exchange**, but it was decided against. Creating a new memoryview carries at least much overhead as an empty string, but there's no need to copy. diff --git a/docs/conf.py b/docs/conf.py index 87fca9e..e4ae5de 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,6 +18,7 @@ # import os import sys + sys.path.insert(0, os.path.abspath('..')) source_parsers = { @@ -47,8 +48,8 @@ master_doc = 'index' # General information about the project. project = u'CoolAMQP' -copyright = u'2016-2020, SMOK Serwis s.c.' -author = u'DMS Serwis s.c.' +copyright = u'2016-2020, SMOK sp. z o. o.' +author = u'SMOK sp. z o. o.' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -79,7 +80,6 @@ pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False - # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -98,13 +98,11 @@ html_theme = 'alabaster' # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] - # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'CoolAMQPdoc' - # -- Options for LaTeX output --------------------------------------------- latex_elements = { @@ -133,7 +131,6 @@ latex_documents = [ u'DMS Serwis s.c.', 'manual'), ] - # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples @@ -143,7 +140,6 @@ man_pages = [ [author], 1) ] - # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples -- GitLab