From: Teryk Bellahsene Date: Tue, 17 Mar 2015 17:05:54 +0000 (+0100) Subject: catch Throwable instead of Exception in Computation threads X-Git-Tag: 5.1-RC2~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a23933b5e85c1b2db95d5baac7f02880ea92779;p=sonarqube.git catch Throwable instead of Exception in Computation threads --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationService.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationService.java index cdaca50a7d1..bc83b093cac 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationService.java @@ -84,10 +84,9 @@ public class ComputationService implements ServerComponent { } item.dto.succeed(); - } catch (Exception e) { + } catch (Throwable e) { item.dto.fail(); throw Throwables.propagate(e); - } finally { item.dto.setFinishedAt(system.now()); saveActivity(item.dto, project); diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationThread.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationThread.java index e70b15feb73..d60cc0b7f62 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationThread.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationThread.java @@ -56,7 +56,7 @@ public class ComputationThread implements Runnable { if (item != null) { try { container.execute(item); - } catch (Exception e) { + } catch (Throwable e) { LOG.error(String.format( "Failed to process analysis report %d of project %s", item.dto.getId(), item.dto.getProjectKey()), e); } finally {