Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probably a race while retransmitting exchanges #43

Closed
aellwein opened this issue Aug 29, 2016 · 2 comments
Closed

Probably a race while retransmitting exchanges #43

aellwein opened this issue Aug 29, 2016 · 2 comments

Comments

@aellwein
Copy link
Contributor

aellwein commented Aug 29, 2016

Hi @chrysn,

while doing some performance tests with observation of about 3000 LWM2M (CoAP) clients against the server, i've encountered following error:

2016-08-29 16:28:54,992 [ERROR] Exception in callback Context._schedule_retransmit.<locals>.retr() at /usr/local/lib/python3.5/site-packages/aiocoap-0.2-py3.5.egg/aiocoap/protocol.py:331
handle: <TimerHandle when=1745359.3182603796 Context._schedule_retransmit.<locals>.retr() at /usr/local/lib/python3.5/site-packages/aiocoap-0.2-py3.5.egg/aiocoap/protocol.py:331>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/usr/local/lib/python3.5/site-packages/aiocoap-0.2-py3.5.egg/aiocoap/protocol.py", line 337, in retr
    self._retransmit(message, timeout, retransmission_counter)
  File "/usr/local/lib/python3.5/site-packages/aiocoap-0.2-py3.5.egg/aiocoap/protocol.py", line 344, in _retransmit
    exchange_monitor, next_retransmission = self._active_exchanges.pop(key)
KeyError: (('::ffff:185.112.178.101', 5683, 0, 0), 28534)

About 6 of 3000 clients failed to notify the server with observed changes. The error message is always from the same line, only the keys are always different, i've extracted them from the tracebacks:

KeyError: (('::ffff:185.112.178.101', 5683, 0, 0), 28534)
KeyError: (('::ffff:185.112.178.101', 5683, 0, 0), 27413)
KeyError: (('::ffff:185.112.178.101', 5683, 0, 0), 2950)
KeyError: (('::ffff:185.112.178.101', 5683, 0, 0), 7791)
KeyError: (('::ffff:185.112.178.101', 5683, 0, 0), 28881)
KeyError: (('::ffff:185.112.178.101', 5683, 0, 0), 13036)

I am not certain about it but i think it could be a race condition, if a key lookup fails (or maybe the exchange times out while so many clients are about to send the notifications to the server?).

Do you have any idea on this?

@aellwein
Copy link
Contributor Author

just to mention, the CoAP retransmission parameters are set to their defaults (no changes there).

@aellwein aellwein changed the title Probably a raise while retransmitting exchanges Probably a race while retransmitting exchanges Aug 31, 2016
@aellwein
Copy link
Contributor Author

The issue was produced by a wrong setup of my client. Not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant