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

AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock' #616

Open
Ali-Razmjoo opened this issue Oct 9, 2022 · 1 comment

Comments

@Ali-Razmjoo
Copy link
Collaborator

Ali-Razmjoo commented Oct 9, 2022

➜ Nettacker git:(issue/609) ✗ python3 nettacker.py -i google.com --profile http -t 1100 -M 5

AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
    self._remove_reader(self._ssock.fileno())
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/selector_events.py", line 92, in close
    self._remove_reader(self._ssock.fileno())
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/selector_events.py", line 99, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/selector_events.py", line 99, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
    self._remove_reader(self._ssock.fileno())
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/selector_events.py", line 99, in _close_self_pipe
    self._close_self_pipe()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/selector_events.py", line 99, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/selector_events.py", line 99, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/selector_events.py", line 99, in _close_self_pipe
@pUrGe12
Copy link

pUrGe12 commented Feb 3, 2025

Okay I haven't completely boiled this down to the root cause, but the issue probably comes due to the number of parallel threads being used. When I ran the same code using only 100 threads it worked. I tracked it down to the wait_for_threads_to_finish so basically if you add even a small delay there through time.sleep(0.02) right after the function definition, you can run this command with 1100 threads.

Adding the line

import asyncio
asyncio.set_event_loop_policy(None)

to app.py in the beginning didn't work.

I am trying to find the reason for this

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