All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backports: lib: remove raising ExecutionError exception
@ 2014-04-25 10:44 Arend van Spriel
  2014-04-26 17:20 ` Luis R. Rodriguez
  2014-04-29  9:58 ` [PATCH V2] " Arend van Spriel
  0 siblings, 2 replies; 5+ messages in thread
From: Arend van Spriel @ 2014-04-25 10:44 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports, Arend van Spriel

In spatch a ExecutionError was raised, but that causes the thread
to finish without closing the outfile and more importantly without
putting (ret, fn) tuple on the return queue. This results in the
threaded_spatch routine to get stuck on the ret_q.get() call. This
patch removes raising the ExecutionError and just return the tuple.
The non-zero return code will result in ExecutionErrorThread exception
anyway.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 lib/bpcoccinelle.py |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/lib/bpcoccinelle.py b/lib/bpcoccinelle.py
index a71f425..fc503f1 100644
--- a/lib/bpcoccinelle.py
+++ b/lib/bpcoccinelle.py
@@ -4,9 +4,6 @@ from lib.tempdir import tempdir
 
 class CoccinelleError(Exception):
     pass
-class ExecutionError(CoccinelleError):
-    def __init__(self, errcode):
-        self.error_code = errcode
 class ExecutionErrorThread(CoccinelleError):
     def __init__(self, errcode, fn, cocci_file, threads, t, logwrite, print_name):
         self.error_code = errcode
@@ -48,8 +45,6 @@ def spatch(cocci_file, outdir,
                                close_fds=True, universal_newlines=True,
                                cwd=outdir)
     sprocess.wait()
-    if sprocess.returncode != 0:
-        raise ExecutionError(sprocess.returncode)
     outfile.close()
     ret_q.put((sprocess.returncode, fn))
 
-- 
1.7.9.5


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

* Re: [PATCH] backports: lib: remove raising ExecutionError exception
  2014-04-25 10:44 [PATCH] backports: lib: remove raising ExecutionError exception Arend van Spriel
@ 2014-04-26 17:20 ` Luis R. Rodriguez
  2014-04-29  9:58 ` [PATCH V2] " Arend van Spriel
  1 sibling, 0 replies; 5+ messages in thread
From: Luis R. Rodriguez @ 2014-04-26 17:20 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: Luis R. Rodriguez, backports@vger.kernel.org

On Fri, Apr 25, 2014 at 3:44 AM, Arend van Spriel <arend@broadcom.com> wrote:
> In spatch a ExecutionError was raised, but that causes the thread
> to finish without closing the outfile and more importantly without
> putting (ret, fn) tuple on the return queue. This results in the
> threaded_spatch routine to get stuck on the ret_q.get() call. This
> patch removes raising the ExecutionError and just return the tuple.
> The non-zero return code will result in ExecutionErrorThread exception
> anyway.
>
> Signed-off-by: Arend van Spriel <arend@broadcom.com>

Thanks but this no longer applies, can you rebase against master?

  Luis

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

* [PATCH V2] backports: lib: remove raising ExecutionError exception
  2014-04-25 10:44 [PATCH] backports: lib: remove raising ExecutionError exception Arend van Spriel
  2014-04-26 17:20 ` Luis R. Rodriguez
@ 2014-04-29  9:58 ` Arend van Spriel
  2014-05-02  1:06   ` Luis R. Rodriguez
  1 sibling, 1 reply; 5+ messages in thread
From: Arend van Spriel @ 2014-04-29  9:58 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports, Arend van Spriel

In spatch a ExecutionError was raised, but that causes the thread
to finish without closing the outfile and more importantly without
putting (ret, fn) tuple on the return queue. This results in the
threaded_spatch routine to get stuck on the ret_q.get() call. This
patch removes raising the ExecutionError and just return the tuple.
The non-zero return code will result in ExecutionErrorThread exception
anyway.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
A bit late but here is the rebased version.

Regards,
Arend
---
 lib/bpcoccinelle.py |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/lib/bpcoccinelle.py b/lib/bpcoccinelle.py
index a71f425..fc503f1 100644
--- a/lib/bpcoccinelle.py
+++ b/lib/bpcoccinelle.py
@@ -4,9 +4,6 @@ from lib.tempdir import tempdir
 
 class CoccinelleError(Exception):
     pass
-class ExecutionError(CoccinelleError):
-    def __init__(self, errcode):
-        self.error_code = errcode
 class ExecutionErrorThread(CoccinelleError):
     def __init__(self, errcode, fn, cocci_file, threads, t, logwrite, print_name):
         self.error_code = errcode
@@ -48,8 +45,6 @@ def spatch(cocci_file, outdir,
                                close_fds=True, universal_newlines=True,
                                cwd=outdir)
     sprocess.wait()
-    if sprocess.returncode != 0:
-        raise ExecutionError(sprocess.returncode)
     outfile.close()
     ret_q.put((sprocess.returncode, fn))
 
-- 
1.7.9.5


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

* Re: [PATCH V2] backports: lib: remove raising ExecutionError exception
  2014-04-29  9:58 ` [PATCH V2] " Arend van Spriel
@ 2014-05-02  1:06   ` Luis R. Rodriguez
  2014-05-02  8:08     ` Arend van Spriel
  0 siblings, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2014-05-02  1:06 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: Luis R. Rodriguez, backports

On Tue, Apr 29, 2014 at 11:58:18AM +0200, Arend van Spriel wrote:
> In spatch a ExecutionError was raised, but that causes the thread
> to finish without closing the outfile and more importantly without
> putting (ret, fn) tuple on the return queue. This results in the
> threaded_spatch routine to get stuck on the ret_q.get() call. This
> patch removes raising the ExecutionError and just return the tuple.
> The non-zero return code will result in ExecutionErrorThread exception
> anyway.
> 
> Signed-off-by: Arend van Spriel <arend@broadcom.com>
> ---
> A bit late but here is the rebased version.

Thanks! Perhaps you're on an outdated tree, the latest tree is:

git://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git

I rebased your patch to fit on top of that though so no need to send
another patch, thanks a lot!

  Luis

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

* Re: [PATCH V2] backports: lib: remove raising ExecutionError exception
  2014-05-02  1:06   ` Luis R. Rodriguez
@ 2014-05-02  8:08     ` Arend van Spriel
  0 siblings, 0 replies; 5+ messages in thread
From: Arend van Spriel @ 2014-05-02  8:08 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Luis R. Rodriguez, backports

On 05/02/14 03:06, Luis R. Rodriguez wrote:
> On Tue, Apr 29, 2014 at 11:58:18AM +0200, Arend van Spriel wrote:
>> In spatch a ExecutionError was raised, but that causes the thread
>> to finish without closing the outfile and more importantly without
>> putting (ret, fn) tuple on the return queue. This results in the
>> threaded_spatch routine to get stuck on the ret_q.get() call. This
>> patch removes raising the ExecutionError and just return the tuple.
>> The non-zero return code will result in ExecutionErrorThread exception
>> anyway.
>>
>> Signed-off-by: Arend van Spriel<arend@broadcom.com>
>> ---
>> A bit late but here is the rebased version.
>
> Thanks! Perhaps you're on an outdated tree, the latest tree is:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git

Definitely barking up the wrong tree ;-)

$ git remote show origin
* remote origin
   Fetch URL: 
git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/backports.git

> I rebased your patch to fit on top of that though so no need to send
> another patch, thanks a lot!

Gr. AvS

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

end of thread, other threads:[~2014-05-02  8:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25 10:44 [PATCH] backports: lib: remove raising ExecutionError exception Arend van Spriel
2014-04-26 17:20 ` Luis R. Rodriguez
2014-04-29  9:58 ` [PATCH V2] " Arend van Spriel
2014-05-02  1:06   ` Luis R. Rodriguez
2014-05-02  8:08     ` Arend van Spriel

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.