All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] bitbake: cooker: clear up state on stateShutdown command
@ 2013-09-10 15:48 Alex DAMIAN
  2013-09-13 12:47 ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Alex DAMIAN @ 2013-09-10 15:48 UTC (permalink / raw)
  To: bitbake-devel, richard.purdie; +Cc: Alexandru DAMIAN

From: Alexandru DAMIAN <alexandru.damian@intel.com>

On resident bitbake server, a stateShutdown command (first
Ctrl-C in client) will leave the server in an unusable state.

This patch forces the server to reload data and begin
processing commands again, coping correctly with Ctrl-C commands.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index c3721aa..42eec2c 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1101,6 +1101,7 @@ class BBCooker:
                 rq.finish_runqueue(True)
             elif self.state == state.shutdown:
                 rq.finish_runqueue(False)
+                self.state = state.initial
             failures = 0
             try:
                 retval = rq.execute_runqueue()
@@ -1191,7 +1192,7 @@ class BBCooker:
         if self.state == state.running:
             return
 
-        if self.state in (state.shutdown, state.stop):
+        if self.state == state.stop:
             self.parser.shutdown(clean=False, force = True)
             sys.exit(1)
 
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] bitbake: cooker: clear up state on stateShutdown command
  2013-09-10 15:48 [PATCH 1/1] bitbake: cooker: clear up state on stateShutdown command Alex DAMIAN
@ 2013-09-13 12:47 ` Richard Purdie
  2013-09-14  8:33   ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2013-09-13 12:47 UTC (permalink / raw)
  To: Alex DAMIAN; +Cc: bitbake-devel

On Tue, 2013-09-10 at 16:48 +0100, Alex DAMIAN wrote:
> From: Alexandru DAMIAN <alexandru.damian@intel.com>
> 
> On resident bitbake server, a stateShutdown command (first
> Ctrl-C in client) will leave the server in an unusable state.
> 
> This patch forces the server to reload data and begin
> processing commands again, coping correctly with Ctrl-C commands.
> 
> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
> 
> diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
> index c3721aa..42eec2c 100644
> --- a/bitbake/lib/bb/cooker.py
> +++ b/bitbake/lib/bb/cooker.py
> @@ -1101,6 +1101,7 @@ class BBCooker:
>                  rq.finish_runqueue(True)
>              elif self.state == state.shutdown:
>                  rq.finish_runqueue(False)
> +                self.state = state.initial
>              failures = 0
>              try:
>                  retval = rq.execute_runqueue()
> @@ -1191,7 +1192,7 @@ class BBCooker:
>          if self.state == state.running:
>              return
>  
> -        if self.state in (state.shutdown, state.stop):
> +        if self.state == state.stop:
>              self.parser.shutdown(clean=False, force = True)
>              sys.exit(1)

This doesn't seem very intuitive. As I read the code above, "shutdown"
means it sits and does nothing, "stop" means it exits? Surely these
should be the other way around?

Cheers,

Richard






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] bitbake: cooker: clear up state on stateShutdown command
  2013-09-13 12:47 ` Richard Purdie
@ 2013-09-14  8:33   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2013-09-14  8:33 UTC (permalink / raw)
  To: Alex DAMIAN; +Cc: bitbake-devel

On Fri, 2013-09-13 at 13:47 +0100, Richard Purdie wrote:
> On Tue, 2013-09-10 at 16:48 +0100, Alex DAMIAN wrote:
> > From: Alexandru DAMIAN <alexandru.damian@intel.com>
> > 
> > On resident bitbake server, a stateShutdown command (first
> > Ctrl-C in client) will leave the server in an unusable state.
> > 
> > This patch forces the server to reload data and begin
> > processing commands again, coping correctly with Ctrl-C commands.
> > 
> > Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
> > 
> > diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
> > index c3721aa..42eec2c 100644
> > --- a/bitbake/lib/bb/cooker.py
> > +++ b/bitbake/lib/bb/cooker.py
> > @@ -1101,6 +1101,7 @@ class BBCooker:
> >                  rq.finish_runqueue(True)
> >              elif self.state == state.shutdown:
> >                  rq.finish_runqueue(False)
> > +                self.state = state.initial
> >              failures = 0
> >              try:
> >                  retval = rq.execute_runqueue()
> > @@ -1191,7 +1192,7 @@ class BBCooker:
> >          if self.state == state.running:
> >              return
> >  
> > -        if self.state in (state.shutdown, state.stop):
> > +        if self.state == state.stop:
> >              self.parser.shutdown(clean=False, force = True)
> >              sys.exit(1)
> 
> This doesn't seem very intuitive. As I read the code above, "shutdown"
> means it sits and does nothing, "stop" means it exits? Surely these
> should be the other way around?

For completeness, my patch series addresses the above problems in
different ways. The underlying problems were the server not being reset
to state.initial after a command failed and the sys.exit() call causing
the server to exit.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-14  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10 15:48 [PATCH 1/1] bitbake: cooker: clear up state on stateShutdown command Alex DAMIAN
2013-09-13 12:47 ` Richard Purdie
2013-09-14  8:33   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.