From d4f23a50e7c40289986af52abfa030027e54a71d Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Fri, 25 Oct 2019 21:38:46 +0200 Subject: [PATCH] DATAES-316 - Revert: NodeClientFactoryBean doesn't shutdown ES on destroy life-cycle. Original PR: #335 --- .../data/elasticsearch/client/NodeClientFactoryBean.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java index 0194ddddd..ef6e463d6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java @@ -152,9 +152,12 @@ public class NodeClientFactoryBean implements FactoryBean, InitializingB try { // NodeClient.close() is a noop, no need to call it here logger.info("Closing elasticSearch node"); - if (node != null) { - node.close(); - } + // closing the Node causes tests to fail in the pipeline build and on some + // "mvn test" runs, there seem still to be tests relying on a running instance that + // is not properly set up. +// if (node != null) { +// node.close(); +// } } catch (final Exception e) { logger.error("Error closing ElasticSearch client: ", e); }