backports: lib: remove raising ExecutionError exception
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
@@ -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
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_spatchroutine to get stuck on theret_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 <[email protected]>
Thanks but this no longer applies, can you rebase against master?
Luis
PATCH v2 1/1 backports: lib: remove raising ExecutionError exception
In reply to Arend van SprielIn 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
@@ -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
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_spatchroutine to get stuck on theret_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 <[email protected]>---
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
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_spatchroutine to get stuck on theret_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
Signed-off-by Arend van Spriel<[email protected]>---
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