Skip to contentSkip to conversation

backports: lib: remove raising ExecutionError exception

PATCH Superseded Arend van Spriel 2 participants 5 messages Apr 25, 2014 – May 2, 2014 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backports: lib: remove raising ExecutionError exception

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.

---
 lib/bpcoccinelle.py |    5 -----
 1 file changed, 5 deletions(-)
lib/bpcoccinelle.py +0 -5
index a71f425..fc503f1 100644
@@ -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))
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 9 lines · 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.

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

Luis

#2 lore raw

PATCH v2 1/1 backports: lib: remove raising ExecutionError exception

In reply to 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.

---
A bit late but here is the rebased version.

Regards,
Arend

---
 lib/bpcoccinelle.py |    5 -----
 1 file changed, 5 deletions(-)
lib/bpcoccinelle.py +0 -5
index a71f425..fc503f1 100644
@@ -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))
 
Signature · 1 line
1.7.9.5
#3 lore raw
Quoted 11 lines · 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.

---
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

#4 lore raw
Quoted 9 lines · Luis R. Rodriguez
Quoted 8 lines · 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.

Quoted 7 lines
Quoted 3 lines

---
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
Quoted 2 lines

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

Gr. AvS