Patchwork [bitbake-devel] serv.py: Fix regression from 972bc43e6d5b

login
register
mail settings
Submitter Jason Wessel
Date Aug. 28, 2013, 2:20 a.m.
Message ID <1377656455-5850-1-git-send-email-jason.wessel@windriver.com>
Download mbox | patch
Permalink /patch/56777/
State Accepted
Commit 85fed8acc3af3e15bf119db2f51c486a9de3646b
Headers show

Comments

Jason Wessel - Aug. 28, 2013, 2:20 a.m.
commit 972bc43e6d5b1207b944b3baa8f9805adb35dda7 (serv.py: Fix hang
when spawned dynamically with bitbake) introduced a regression,
because the wrong patch was submitted.  The syntax was incorrect in
the original patch.  The logger iterator must be used with a call to
getLogger().

[YOCTO #5059]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 lib/prserv/serv.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Khem Raj - Aug. 28, 2013, 7:40 a.m.
On Aug 27, 2013, at 7:20 PM, Jason Wessel <jason.wessel@windriver.com> wrote:

> commit 972bc43e6d5b1207b944b3baa8f9805adb35dda7 (serv.py: Fix hang
> when spawned dynamically with bitbake) introduced a regression,
> because the wrong patch was submitted.  The syntax was incorrect in
> the original patch.  The logger iterator must be used with a call to
> getLogger().

I was seeing errors like

NOTE: Started PRServer with DBfile: /builds1/angstrom/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 55073, PID: 20469
ERROR: PRservice 127.0.0.1:55073 not available

Which I narrowed down to 972bc43e6d5b as well.

This patch fixes it.

> 
> [YOCTO #5059]
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
> ---
> lib/prserv/serv.py |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/prserv/serv.py b/lib/prserv/serv.py
> index 781f054..6d0c718 100644
> --- a/lib/prserv/serv.py
> +++ b/lib/prserv/serv.py
> @@ -146,7 +146,7 @@ class PRServer(SimpleXMLRPCServer):
>         # Clear out all log handlers prior to the fork() to avoid calling
>         # event handlers not part of the PRserver
>         for logger_iter in logging.Logger.manager.loggerDict.keys():
> -            logger_iter.handlers = []
> +            logging.getLogger(logger_iter).handlers = []
> 
>         # Ensure logging makes it to the logfile
>         streamhandler = logging.StreamHandler()
> -- 
> 1.7.9.5
> 
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel

Patch

diff --git a/lib/prserv/serv.py b/lib/prserv/serv.py
index 781f054..6d0c718 100644
--- a/lib/prserv/serv.py
+++ b/lib/prserv/serv.py
@@ -146,7 +146,7 @@  class PRServer(SimpleXMLRPCServer):
         # Clear out all log handlers prior to the fork() to avoid calling
         # event handlers not part of the PRserver
         for logger_iter in logging.Logger.manager.loggerDict.keys():
-            logger_iter.handlers = []
+            logging.getLogger(logger_iter).handlers = []
 
         # Ensure logging makes it to the logfile
         streamhandler = logging.StreamHandler()