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

added time delay between requests to run parallel module scans #1016

Closed
wants to merge 1 commit into from

Conversation

pUrGe12
Copy link
Contributor

@pUrGe12 pUrGe12 commented Feb 18, 2025

Proposed change

Fix for issue #616. The issue is likely happening due to race conditions with python's garbage collector trying to delete a loop that's running causing the BaseEventLoop.__del__ exception, which causes the _sock exception. The simple fix for this is to give a small delay to in between each request to let threads finish execution and let python handle the deletion properly.

If we run the following command with this change,

 python3 nettacker.py -i google.com --profile http -t 1100 -M 5

We get the complete output without errors. It should also be noted that the delay doesn't cause problems in parallel execution because we only delay threads. Using await asyncio.sleep() also won't matter much because there are no async tasks to handle control to.

Additionally, since its the CPU handling the threads, with time.sleep() it removes the asleep thread from the queue, hence sleep here won't block execution for other threads.

Type of change

  • New core framework functionality
  • Bugfix (non-breaking change which fixes an issue)
  • Code refactoring without any functionality changes
  • New or existing module/payload change
  • Localization improvement
  • Dependency upgrade
  • Documentation improvement

Checklist

  • I've followed the [contributing guidelines][contributing-guidelines]
  • I've run make pre-commit, it didn't generate any changes
  • I've run make test, all tests passed locally

@pUrGe12
Copy link
Contributor Author

pUrGe12 commented Feb 20, 2025

Closing this now, a better solution can be implemented.

@pUrGe12 pUrGe12 closed this Feb 20, 2025
@pUrGe12 pUrGe12 deleted the fix_race_condition branch February 20, 2025 14:58
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

Successfully merging this pull request may close these issues.

1 participant