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

Synchroniser.notify hits 'unexpected method notification' in tests. #94

Open
alexjc opened this issue Feb 22, 2017 · 1 comment
Open

Comments

@alexjc
Copy link

alexjc commented Feb 22, 2017

This is hard to reproduce, but in automated tests with two browsers connected we hit this problem reliably:

            try:
                fut = self._futures[method].popleft()
            except IndexError:
                # XXX: we can't just ignore this.
                log.error("Got an unexpected method notification %s", method)
                return

The server is RabbitMQ but this looks like a race condition in asynqp itself. Before we start debugging, any ideas what could be the cause? Thanks!

@alexjc
Copy link
Author

alexjc commented Feb 22, 2017

I traced this down to Synchronizer class that likely should throw a more specific error when something is attempted that doesn't work with this implementation:

     def await(self, *expected_methods):
         fut = asyncio.Future(loop=self._loop)

         if self.connection_exc is not None:
             fut.set_exception(self.connection_exc)
             return fut

         for method in expected_methods:
+            assert method not in self._futures, "Awaiting multiple %s messages not supported" % method
             self._futures[method].append(fut)
         return fut

How are Channels supposed to be used in asynqp? One per queue? If I want to consume as well as send do I need a separate Channel?

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