Socket Error

22 views
Skip to first unread message

vishalb...@gmail.com

unread,
Jun 22, 2021, 11:00:16 AM6/22/21
to thespian.py

Hi Kevin,
I hope you are doing well!

I have recently encountered an error while passing a message between actors.
The message can be of class type or a dict but the message contains content of parsed xml file in list of dict format(file can be as big as 25-30MB, so there is lot of content).

%CPU utilization gets increased till 90% while this actor's logic is getting executed.

Below is the error from thespian.log file:

p46952 ERR  Socket error sending to ActorAddr-(T|:52377) on <socket.socket fd=36, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>: [Errno 22] Invalid argument / 22: ************* TransportIntent(ActorAddr-(T|:52377)

The actor uses xml.etree.ElementTree package to parse through the xml, it goes upto 4 levels deep while parsing the xml and then updating a list of dict with information extracted.

Can you please let me know the possible reason for this and any changes I should do or any possible solution.

Thanks
Vishal

Kevin Quick

unread,
Jun 23, 2021, 2:17:24 AM6/23/21
to vishalb...@gmail.com, thespian.py
Hi Vishal,

I'm not entirely sure what could be happening here. The error is
coming from the call to a `socket.send()` in the
thespian/system/transport/TCPTransport.py file and there's no obvious
reasons why the send would be throwing that exception.

The error message is generated from approximately line 920 in that
file; it might be interesting to enhance the error message:

thesplog('Socket error sending to %s on %s: %s / %s: %s [%s of %s
rem]', intent.targetAddr, intent.socket, str(err), err.errno, intent,
len(intent.serMsg), intent.amtSent, level=logging.ERROR)

You might also try some simple testing:

$ python
>>> import socket
>>> s = socket.socket()
>>> s.bind( ("", 0) )
>>> s.connect( ("", 22) )
>>> buf = (b"D" * 30 * 1024 * 1024) # a 30MB buffer full of D characters
>>> s.send(buf)

You can try different buf contents and see if anything results in the errno 22.

Regards,
Kevin
> --
> You received this message because you are subscribed to the Google Groups "thespian.py" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to thespianpy+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/thespianpy/146bc4a3-defc-4204-be2d-a391b9da15bcn%40googlegroups.com.



--
-KQ
Reply all
Reply to author
Forward
0 new messages