[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: [soprano] client: Fix 100% CPU usage when killing virtuoso.
From: Sebastian TrĂ¼g <trueg () kde ! org>
Date: 2012-07-09 20:11:58
Message-ID: 4FFB3B0E.9040205 () kde ! org
[Download RAW message or body]
Hi David,
could you please in the future handle bug fixes in Soprano as follows:
- always push them to the latest stable branch
- then merge the stable branch into master.
Thanks,
Sebastian
On 07/08/2012 09:30 AM, David Faure wrote:
> Git commit 92adb74bdf6d1bb95d4014a6fd1df9ccb41ddff7 by David Faure.
> Committed on 06/07/2012 at 21:06.
> Pushed by dfaure into branch 'master'.
>
> Fix 100% CPU usage when killing virtuoso.
>
> read() returned 0 bytes, select() returned "ready", GOTO 10.
> Apparently 0 bytes means "end of file", so error immediately when it happens.
>
> M +6 -3 client/socketstream.cpp
>
> http://commits.kde.org/soprano/92adb74bdf6d1bb95d4014a6fd1df9ccb41ddff7
>
> diff --git a/client/socketstream.cpp b/client/socketstream.cpp
> index 42645ad..208efaf 100644
> --- a/client/socketstream.cpp
> +++ b/client/socketstream.cpp
> @@ -28,7 +28,7 @@
> #include "literalvalue.h"
> #include "locator.h"
> #include "languagetag.h"
> -
> +#include<qdebug.h>
>
> Soprano::SocketStream::SocketStream( Soprano::Socket* dev )
> : m_device( dev )
> @@ -251,13 +251,16 @@ bool Soprano::SocketStream::read( char* data, qint64 size )
> return false;
> }
> else if ( r == 0&& size> 0 ) {
> - if ( !m_device->waitForReadyRead( 30000 ) ) {
> + // If virtuoso is killed, read returns 0, but select returns ok. This means end of file.
> + // ### TODO: check with Thiago
> + //if ( !m_device->waitForReadyRead( 30000 ) ) {
> + qWarning()<< "GOT 0 BYTES -> TIMEOUT";
> setError( Error::Error( QString( "Timeout when reading after %1 of %2 bytes (%3)." )
> .arg( cnt )
> .arg( size )
> .arg( m_device->lastError().message() ) ) );
> return false;
> - }
> + //}
> }
>
> cnt += r;
>
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic