c4software / python-sitemap

Mini website crawler to make sitemap from a website.
GNU General Public License v3.0
366 stars 110 forks source link

BUG: remove race condition in multithreading #63

Closed Garrett-R closed 4 years ago

Garrett-R commented 4 years ago

I realize that I introduced a race condition and while it may have been very unlikely to have occurred in practice, I think it's good to remove it anyway.

To reproduce the race condition error, I added a sleep(10) into the for loop (for url in urls_to_crawl:) and indeed it gives:

RuntimeError: Set changed size during iteration