Greg Padgett has uploaded a new change for review. Change subject: notifier: resource leak using all available db connections ......................................................................
notifier: resource leak using all available db connections Only initialize the data source once instead of each event loop, preventing existing connections from being orphaned. Change-Id: Ib7db8bdd66ca8f6412b1ef709c141b0b97dffbfb Bug-Url: https://bugzilla.redhat.com/905709 Signed-off-by: Greg Padgett <[email protected]> --- M backend/manager/tools/engine-notifier/engine-notifier-service/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java 1 file changed, 1 insertion(+), 16 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/55/11555/1 diff --git a/backend/manager/tools/engine-notifier/engine-notifier-service/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java b/backend/manager/tools/engine-notifier/engine-notifier-service/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java index 2e8f035..c0d2949 100644 --- a/backend/manager/tools/engine-notifier/engine-notifier-service/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java +++ b/backend/manager/tools/engine-notifier/engine-notifier-service/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java @@ -50,6 +50,7 @@ public NotificationService(NotificationConfigurator notificationConf) throws NotificationServiceException { this.prop = notificationConf.getProperties(); + initConnectivity(); initConfigurationProperties(); } @@ -83,7 +84,6 @@ throw new NotificationServiceException(err,e); } } - initConnectivity(); initMethodMapper(); } @@ -93,7 +93,6 @@ public void run() { try { log.debug("Start event notification service iteration"); - startup(); processEvents(); if (shouldDeleteHistory) { deleteObseleteHistoryData(); @@ -103,20 +102,6 @@ if (!Thread.interrupted()) { log.error(String.format("Failed to run the service: [%s]", e.getMessage()), e); } - } - } - - /** - * Starts or verified that required resources for the service are available - * @throws NotificationServiceException - * specifies which resource not available and a cause - */ - private void startup() throws NotificationServiceException { - try { - ds = new StandaloneDataSource(); - } - catch (SQLException exception) { - throw new NotificationServiceException("Failed to initialize the connection helper", exception); } } -- To view, visit http://gerrit.ovirt.org/11555 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7db8bdd66ca8f6412b1ef709c141b0b97dffbfb Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Greg Padgett <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
