hamedramzi / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
0 stars 0 forks source link

can't exit #335

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
stopping the io service will break operations that are supposed to be completed 
before quitting.

could you enable asio debugging by defining TORRENT_ASIO_DEBUGGING to see which 
operations are still outstanding.

Original issue reported on code.google.com by jack....@gmail.com on 13 Jun 2012 at 2:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I believe I've found the underlying cause of this problem. Please try this 
patch instead of yours, since this will allow trackers to be stopped when 
shutting down, but without exceeding the time out.

Index: src/connection_queue.cpp
===================================================================
--- src/connection_queue.cpp    (revision 7177)
+++ src/connection_queue.cpp    (working copy)
@@ -277,7 +277,8 @@
 #endif

        TORRENT_ASSERT(!e || e == error::operation_aborted);
-       if (e) return;
+       if (e && m_num_connecting == 0)
+           return;

        ptime next_expire = max_time();
        ptime now = time_now_hires() + milliseconds(100);

I've checked this in to the trunk and RC_0_16 branches.

Original comment by arvid.no...@gmail.com on 14 Jul 2012 at 8:34

GoogleCodeExporter commented 9 years ago
actually. That patch turns out to cause another issue. I'm still looking for a 
proper fix for this. I'm expecting to rewrite connection_queue in trunk and 
introduce some small hack to make this work in 0.16.x

Original comment by arvid.no...@gmail.com on 15 Jul 2012 at 9:19

GoogleCodeExporter commented 9 years ago
Could you try this one? It appears to be working for me, but It's hard to say 
because the shutdown hang doesn't happen very often in the first place (and it 
seems even less often when you're looking for it).

Original comment by arvid.no...@gmail.com on 15 Jul 2012 at 11:16

Attachments: