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

The script hangs when "arguments.threads" is set to 1. #18

Open
darumaseye opened this issue Aug 23, 2019 · 1 comment
Open

The script hangs when "arguments.threads" is set to 1. #18

darumaseye opened this issue Aug 23, 2019 · 1 comment

Comments

@darumaseye
Copy link

Hi! First of all, thanks for the work!
Secondly... when lunching the script without -t argument:

python AWSBucketDump.py -D -l BucketNames.txt -g interesting_Keywords.txt

It seems that the script hangs right before downloading the files:

Downloads enabled (-D), will be saved to current directory.
Starting thread...
Queuing http://####.s3.amazonaws.com...
Fetching http://####.s3.amazonaws.com...
Pilfering http://####.s3.amazonaws.com...
Collectable: http://####.s3.amazonaws.com/####
Collectable: http://####.s3.amazonaws.com/####
...
...


I think to have spotted the problem.

Due to "for i in range(1, arguments.threads)" in:

# start download workers
for i in range(1, arguments.threads):
t = Thread(target=downloadWorker)
t.daemon = True
t.start()

if the user sets "arguments.threads" = 1, no downloadworker will be generated, so the queue will not be empied, causing "download_q.join()" to hang:

if arguments.download:
download_q.join()

A possible solution could be to change

"for` i in range(1, arguments.threads)"

in

"for i in range(0, arguments.threads)"

Is this possible?
I hope i was helpful.

@jbpratt
Copy link
Contributor

jbpratt commented Dec 23, 2019

@darumaseye It does seem that the download thread does not kick off when arguments.thread is equal to 1 and it is set by 1 by default so this may lead to it never kicking off by default.

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