Bug 181354

Summary: High CPU load caused by net-p2p/libtorrent-devel
Product: Ports & Packages Reporter: Darren <darren780>
Component: Individual Port(s)Assignee: Andrej Zverev <az>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Darren 2013-08-17 14:50:00 UTC
 --1791075261-94781507-1376746912=:11726
 Content-Type: text/plain; charset=us-ascii
 
 [editor's note: the referenced PR has a successful fix for net-p2p/libtorrent]

 www.freebsd.org/cgi/query-pr.cgi?pr=ports/170766
 
 This same patch can be directly copied to the libtorrent-devel/files/ folder as it needs to fix the same problem there.
 I just solved my freezing problem with it.
 
 The non-devel version seems to have some issues with ssl, so I was forced to move to -devel.
 
 
 -Darren
 
 --1791075261-94781507-1376746912=:11726--
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-08-18 00:28:01 UTC
Responsible Changed
From-To: gnats-admin->freebsd-ports-bugs

rescue from the 'pending' category.
Comment 2 Edwin Groothuis freebsd_committer 2013-08-18 00:30:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->az

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 3 dfilter service freebsd_committer 2013-08-25 16:17:32 UTC
Author: az
Date: Sun Aug 25 15:17:18 2013
New Revision: 325348
URL: http://svnweb.freebsd.org/changeset/ports/325348

Log:
  - add patch from net-p2p/libtorrent which can fix High CPU issue
  - bump portrevisions
  
  PR:		ports/181354
  Submitted by:	Darren <darren780@yahoo.com>

Added:
  head/net-p2p/libtorrent-devel/files/patch-src_torrent_utils_thread__base.cc
     - copied unchanged from r325335, head/net-p2p/libtorrent/files/patch-src_torrent_utils_thread__base.cc
Modified:
  head/net-p2p/libtorrent-devel/Makefile
  head/net-p2p/rtorrent-devel/Makefile

Modified: head/net-p2p/libtorrent-devel/Makefile
==============================================================================
--- head/net-p2p/libtorrent-devel/Makefile	Sun Aug 25 14:03:11 2013	(r325347)
+++ head/net-p2p/libtorrent-devel/Makefile	Sun Aug 25 15:17:18 2013	(r325348)
@@ -3,7 +3,7 @@
 
 PORTNAME=	libtorrent-devel
 PORTVERSION=	0.13.3
-PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	net-p2p
 MASTER_SITES=	http://libtorrent.rakshasa.no/downloads/
 DISTNAME=	${PORTNAME:S/-devel//}-${PORTVERSION}

Copied: head/net-p2p/libtorrent-devel/files/patch-src_torrent_utils_thread__base.cc (from r325335, head/net-p2p/libtorrent/files/patch-src_torrent_utils_thread__base.cc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/libtorrent-devel/files/patch-src_torrent_utils_thread__base.cc	Sun Aug 25 15:17:18 2013	(r325348, copy of r325335, head/net-p2p/libtorrent/files/patch-src_torrent_utils_thread__base.cc)
@@ -0,0 +1,20 @@
+--- src/torrent/utils/thread_base.cc.orig
++++ src/torrent/utils/thread_base.cc
+@@ -88,6 +88,8 @@ thread_base::stop_thread_wait() {
+ 
+ void
+ thread_base::interrupt() {
++  int sleep_length = 0;
++
+   __sync_fetch_and_or(&m_flags, flag_no_timeout);
+ 
+   while (is_polling() && has_no_timeout()) {
+@@ -96,7 +98,8 @@ thread_base::interrupt() {
+     if (!(is_polling() && has_no_timeout()))
+       return;
+ 
+-    usleep(0);
++    usleep(sleep_length);
++    sleep_length = std::min(sleep_length + 50, 1000);
+   }
+ }

Modified: head/net-p2p/rtorrent-devel/Makefile
==============================================================================
--- head/net-p2p/rtorrent-devel/Makefile	Sun Aug 25 14:03:11 2013	(r325347)
+++ head/net-p2p/rtorrent-devel/Makefile	Sun Aug 25 15:17:18 2013	(r325348)
@@ -11,8 +11,8 @@ DISTNAME=	${PORTNAME:S/-devel//}-${PORTV
 MAINTAINER=	az@FreeBSD.org
 COMMENT=	BitTorrent Client written in C++ (development version)
 
-BUILD_DEPENDS=	libtorrent-devel=0.13.3:${PORTSDIR}/net-p2p/libtorrent-devel
-RUN_DEPENDS=	libtorrent-devel=0.13.3:${PORTSDIR}/net-p2p/libtorrent-devel
+BUILD_DEPENDS=	libtorrent-devel=0.13.3_1:${PORTSDIR}/net-p2p/libtorrent-devel
+RUN_DEPENDS=	libtorrent-devel=0.13.3_1:${PORTSDIR}/net-p2p/libtorrent-devel
 LIB_DEPENDS=	curl:${PORTSDIR}/ftp/curl
 
 CONFLICTS=	rtorrent-[0-9]*
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Andrej Zverev freebsd_committer 2013-08-25 16:18:36 UTC
State Changed
From-To: open->closed

Committed. Thanks!