Hello all. I’m dabbling in asynchronous programming trying to implement a web crawler. I’m having a problem with figuring out how to resolve a deadlock that pops up in my code. The offending line seems to be at https://github.com/iancormac84/asyncscraper/blob/master/src/main.rs#L135. What’s confusing me is that at this point in the program execution, there shouldn’t be anything stopping the Mutex from being acquired immediately. Maybe I’m wrong. I don’t fully understand the Futures execution model as yet, so I’m obviously committing a no-no. Can someone provide me with some guidance, please? Thanks!
It looks like you’re still holding the lock in
crawl_urls at that point, I’m not sure whether futures
Mutex is re-entrant, but if you’re getting a deadlock I would guess not.