WebSocket Server gets Error

#1

Hi,

I have setup a WebSocket Server using Autobahn.

My server will send several small messages ( ~2kb ) to clients every minutes.

The Server running without any problems at first.

However, errors sometimes occur around one day later…Server then can’t be connected until restart it.

Error message:

Unhandled Error

Traceback (most recent call last):

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/python/log.py”, line 73, in callWithContext

return context.call({ILogContext: newCtx}, func, *args, **kw)

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/python/context.py”, line 118, in callWithContext

return self.currentContext().callWithContext(ctx, func, *args, **kw)

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/python/context.py”, line 81, in callWithContext

return func(*args,**kw)

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/internet/posixbase.py”, line 614, in _doReadOrWrite

why = selectable.doRead()

— —

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/internet/tcp.py”, line 1069, in doRead

transport = self.transport(skt, protocol, addr, self, s, self.reactor)

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/internet/tcp.py”, line 786, in init

self.startReading()

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/internet/abstract.py”, line 429, in startReading

self.reactor.addReader(self)

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/internet/epollreactor.py”, line 256, in addReader

_epoll.EPOLLIN, _epoll.EPOLLOUT)

File “/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/internet/epollreactor.py”, line 240, in _add

self._poller.modify(fd, flags)

exceptions.IOError: [Errno 2] No such file or directory

I am using Python 2.6, Autobahn 0.5.9, Twisted 12.3.0 on CentOS 6.3

Does anyone know how to fix this issue?

Thanks very much!!!

0 Likes

#2

Hi,

I have setup a WebSocket Server using Autobahn.
My server will send several small messages ( ~2kb ) to clients every
minutes.

The Server running without any problems at first.
However, errors sometimes occur around one day later...Server then can't
be connected until restart it.

Error message:

..

"/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/internet/epollreactor.py",
line 240, in _add
     self._poller.modify(fd, flags)
exceptions.IOError: [Errno 2] No such file or directory

I am using Python 2.6, Autobahn 0.5.9, Twisted 12.3.0 on CentOS 6.3

The traceback origin is within Twisted epoll reactor. It seems the underyling socket somehow has disappeared ..

Could you try running your server using the select reactor and see if you can reproduce the problem?

Another thing to try: use latest Python 2.7.

One more: is your server behind a residential ADSL connection which might get automatically disconnected every 24h?

In any case it's unlikely to be specifically Autobahn related .. but I'd be interested in the root cause anyway ..

Tobias

···

Am 20.03.2013 04:05, schrieb Keith:

0 Likes

#3

Thank you for your advise! Tobias!

I tried to run the server using the select reactor.

It causes another problem that the server usually cannot send Ping to client. (send Message is fine)

By observation, it seems that select reactor collected several ping message and then send it out…(not sure)

And I have upgraded all software to test whether the issue still exist.

( Python: 2.7.3, Autobahn:0.5.41, Twisted: 12.3.0 )

This may need a overnight test…report the result later.

For automatically disconnected every 24h, the server is placed at local network and would not be disconnected automatically.

Thanks very much!!

Tobias Oberstein於 2013年3月20日星期三UTC+8下午4時56分29秒寫道:

···

Am 20.03.2013 04:05, schrieb Keith:

Hi,

I have setup a WebSocket Server using Autobahn.

My server will send several small messages ( ~2kb ) to clients every

minutes.

The Server running without any problems at first.

However, errors sometimes occur around one day later…Server then can’t

be connected until restart it.

Error message:

“/usr/lib64/python2.6/site-packages/Twisted-12.3.0-py2.6-linux-x86_64.egg/twisted/internet/epollreactor.py”,

line 240, in _add

 self._poller.modify(fd, flags)

exceptions.IOError: [Errno 2] No such file or directory

I am using Python 2.6, Autobahn 0.5.9, Twisted 12.3.0 on CentOS 6.3

The traceback origin is within Twisted epoll reactor. It seems the
underyling socket somehow has disappeared …

Could you try running your server using the select reactor and see if
you can reproduce the problem?

Another thing to try: use latest Python 2.7.

One more: is your server behind a residential ADSL connection which
might get automatically disconnected every 24h?

In any case it’s unlikely to be specifically Autobahn related … but I’d
be interested in the root cause anyway …

Tobias

0 Likes

#4

Finally, I find that the problem failed to send ping when using select reactor is my fault.

Server is running very fine using select reactor instead of epoll reactor.

Problem seems solved, I will test the server with poll reactor next.

Thanks very much!!

0 Likes

#5

Finally, I find that the problem failed to send ping when using select
reactor is my fault.
Server is running very fine using select reactor instead of epoll reactor.

Problem seems solved, I will test the server with poll reactor next.

Thanks very much!!

Great. Good to hear it works for you now ..

···

Am 10.04.2013 03:12, schrieb Keith:

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes