From d1a4989e84365fbd280f383145a6a13e7fd6b615 Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 23 Feb 2010 23:37:33 +0200 Subject: [PATCH] fix possible node serialization problem (dont share the byte buffer) --- .../org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java index fadcb9eb57a..357a3b011f5 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/jgroups/JgroupsDiscovery.java @@ -363,7 +363,7 @@ public class JgroupsDiscovery extends AbstractComponent implements Discovery, Re ByteArrayDataOutputStream os = new ByteArrayDataOutputStream(); localNode.writeTo(os); os.close(); - return os.unsafeByteArray(); + return os.copiedByteArray(); } private void sendInitialStateEventIfNeeded() {