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

ThreadPoolServer spams warning logs #91

Closed
oliverdrake opened this issue Jul 30, 2012 · 2 comments
Closed

ThreadPoolServer spams warning logs #91

oliverdrake opened this issue Jul 30, 2012 · 2 comments

Comments

@oliverdrake
Copy link

I get endless warning logs from my server if I use ThreadPoolServer on Ubuntu 11.10 amd64 as soon as I connect with a single client. To reproduce:

Server side:

import rpyc
from rpyc.utils.server import ThreadPoolServer
import logging
logging.basicConfig()

class MyService(rpyc.Service):

    def on_connect(self):
        # code that runs when a connection is created
        # (to init the serivce, if needed)
        pass

    def on_disconnect(self):
        # code that runs when the connection has already closed
        # (to finalize the service, if needed)
        pass

    def exposed_get_answer(self): # this is an exposed method
        return 42

    def get_question(self):  # while this method is not exposed
        return "what is the airspeed velocity of an unladen swallow?"

t = ThreadPoolServer(MyService, port=18867)
t.start()

Client side:

from rpyc.utils.factory import connect
c = connect("ip address", 18867)

Once the connection is established the server will start spamming the following log message:

WARNING:MY/18867:failed to poll clients, caught exception : 'int' object is not iterable

My setup:
uname -a
Linux WS3232 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 20:45:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
python --version
Python 2.7.2+
rpyc==3.2.1

@oliverdrake
Copy link
Author

ThreadPoolServer expects poll() to return a list of tuples, which it does if SelectingPoll is used, but if PollingPoll is used we only get a list of integers. I managed to make ThreadPoolServer stop complaining by hacking the following into compat.py, line 119:

processed.append((fd, mask))

instead of:

processed.append(fd)

@oliverdrake
Copy link
Author

Thanks for the quick response :)

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

2 participants