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

gevent errors #2

Open
huaraz opened this issue Oct 7, 2021 · 5 comments
Open

gevent errors #2

huaraz opened this issue Oct 7, 2021 · 5 comments
Assignees

Comments

@huaraz
Copy link

huaraz commented Oct 7, 2021

Using this version I see a lot of gevent socket errors. Is this a gevent issue ?

I used before version 0.2.2 which did not have these errors.

Markus

@COUR4G3
Copy link
Owner

COUR4G3 commented Oct 8, 2021

If you share some of the logs I'll take a look.

@COUR4G3 COUR4G3 self-assigned this Oct 8, 2021
@huaraz
Copy link
Author

huaraz commented Oct 8, 2021

Here are 2 typical errors:

Traceback (most recent call last):

File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Proxy_Negotiate-1.0.0-py3.7.egg/proxy_neg
otiate.py", line 20, in forward

data = src.recv(1024)

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gevent/_socketcommon.py", line 657, in recv

return self._sock.recv(*args)

ConnectionResetError: [Errno 54] Connection reset by peer

2021-10-07T21:37:22Z <Greenlet at 0x7f9942345908: forward(<gevent._socket3.socket [closed] at 0x7f994235e388, <gevent._socket3.socket at 0x7f99423e09a0 object, )> failed with ConnectionResetError

Traceback (most recent call last):

File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Proxy_Negotiate-1.0.0-py3.7.egg/proxy_negotiate.py", line 23, in forward

dst.sendall(data)

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gevent/_socketcommon.py", line 699, in sendall

return _sendall(self, data_memory, flags)

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gevent/_socketcommon.py", line 396, in _sendall

chunk_size = max(socket.getsockopt(SOL_SOCKET, SO_SNDBUF), 1024 * 1024)

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gevent/_socketcommon.py", line 569, in getsockopt

return self._sock.getsockopt(*args)

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gevent/_socket3.py", line 55, in _dummy

raise OSError(EBADF, 'Bad file descriptor')

OSError: [Errno 9] Bad file descriptor

2021-10-07T21:37:22Z <Greenlet at 0x7f99423456d8: forward(<gevent._socket3.socket [closed] at 0x7f99423e09a0, <gevent._socket3.socket [closed] at 0x7f994235e388)> failed with OSError

@COUR4G3
Copy link
Owner

COUR4G3 commented Oct 8, 2021

Ah yes, I haven't put any try/except blocks around the send and receive methods so whenever this is a disconnect or dropped connection it'll stack trace. So safe to ignore.

@huaraz
Copy link
Author

huaraz commented Oct 8, 2021

Ok. It be nice to not have them. As you may overlook real errors.

Thank you
Markus

@COUR4G3
Copy link
Owner

COUR4G3 commented Oct 9, 2021

Agreed. Going to wrap the send and receive parts in try-except blocks just to catch the Connection Reset and file descriptor errors that occur when the connection closes.

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