[geode-native] branch develop updated: Geode 8892 loosen log file name rules (#734)

2021-01-29 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
 new 5600a6b  Geode 8892 loosen log file name rules (#734)
5600a6b is described below

commit 5600a6b1fc26adddcb8214a9d079ec5627ff1807
Author: Blake Bender 
AuthorDate: Fri Jan 29 17:42:23 2021 -0800

Geode 8892 loosen log file name rules (#734)

- This was breaking some existing users, whose file names were suddenly
  deemed invalid, even though perfectly legal on their platform.
- Add unit test case for parens and spaces in filename on Windows
- Add hash symbol to valid filename test.  Turns out these are okay on 
Windows too
---
 cppcache/src/Log.cpp  | 21 +
 cppcache/test/LoggingTest.cpp |  5 +
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/cppcache/src/Log.cpp b/cppcache/src/Log.cpp
index 9e7c15a..aaf71b9 100644
--- a/cppcache/src/Log.cpp
+++ b/cppcache/src/Log.cpp
@@ -102,14 +102,6 @@ void Log::validateSizeLimits(int64_t fileSizeLimit, 
int64_t diskSpaceLimit) {
   }
 }
 
-void Log::validateLogFileName(const std::string& filename) {
-  auto nameToCheck = boost::filesystem::path(filename).filename().string();
-  if (!boost::filesystem::portable_file_name(nameToCheck)) {
-throw IllegalArgumentException("Specified log file (" + nameToCheck +
-   ") is not a valid portable name.");
-  }
-}
-
 void Log::init(LogLevel level, const char* logFileName, int32_t logFileLimit,
int64_t logDiskSpaceLimit) {
   auto logFileNameString =
@@ -211,12 +203,11 @@ void Log::init(LogLevel level, const std::string& 
logFileName,
   }
   s_logLevel = level;
 
-  std::lock_guard guard(g_logMutex);
+  try {
+std::lock_guard guard(g_logMutex);
 
-  g_hostName = boost::asio::ip::host_name();
+g_hostName = boost::asio::ip::host_name();
 
-  if (logFileName.length()) {
-validateLogFileName(logFileName);
 g_fullpath =
 boost::filesystem::absolute(boost::filesystem::path(logFileName));
 
@@ -245,6 +236,12 @@ void Log::init(LogLevel level, const std::string& 
logFileName,
   rollLogFile();
 }
 writeBanner();
+  } catch (const boost::exception&) {
+auto msg = std::string("Unable to log to file '") + logFileName + "'";
+throw IllegalArgumentException(msg.c_str());
+  } catch (const std::exception&) {
+auto msg = std::string("Unable to log to file '") + logFileName + "'";
+throw IllegalArgumentException(msg.c_str());
   }
 }
 
diff --git a/cppcache/test/LoggingTest.cpp b/cppcache/test/LoggingTest.cpp
index cbeb4d3..ce68ef9 100644
--- a/cppcache/test/LoggingTest.cpp
+++ b/cppcache/test/LoggingTest.cpp
@@ -238,6 +238,11 @@ TEST_F(LoggingTest, logInit) {
   apache::geode::client::LogLevel::Config, "LoggingTest.log"));
   apache::geode::client::Log::close();
 
+  // Init with legal filename with (), #, and space
+  ASSERT_NO_THROW(apache::geode::client::Log::init(
+  apache::geode::client::LogLevel::Config, "LoggingTest (#).log"));
+  apache::geode::client::Log::close();
+
   // Init with invalid filename
   ASSERT_THROW(apache::geode::client::Log::init(
apache::geode::client::LogLevel::Config, "#?$?%.log"),



[geode] 01/01: GEODE-8895: processChunkResponse encountering broken socket should throw IOException to retrty

2021-01-29 Thread zhouxj
This is an automated email from the ASF dual-hosted git repository.

zhouxj pushed a commit to branch feature/GEODE-8895
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 76b4f190eecf14a7e2c1cde188d1a3d4b8f69f9d
Author: zhouxh 
AuthorDate: Fri Jan 29 14:00:03 2021 -0800

GEODE-8895: processChunkResponse encountering broken socket should throw 
IOException to retrty
---
 .../geode/cache/client/internal/AbstractOp.java|  3 +-
 .../cache/client/internal/AbstractOpTest.java  | 41 ++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
 
b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
index 412fdde..7c40b9e 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
@@ -15,6 +15,7 @@
 
 package org.apache.geode.cache.client.internal;
 
+import java.io.IOException;
 import java.net.SocketTimeoutException;
 
 import org.apache.logging.log4j.Logger;
@@ -346,7 +347,7 @@ public abstract class AbstractOp implements Op {
 Part part = msg.getPart(0);
 throw new ServerOperationException(part.getString());
   } else {
-throw new InternalGemFireError("Unexpected message type " + 
MessageType.getString(msgType));
+throw new IOException("Unexpected message type " + 
MessageType.getString(msgType));
   }
 }
   }
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AbstractOpTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AbstractOpTest.java
index 5327a21..651059a 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AbstractOpTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AbstractOpTest.java
@@ -17,12 +17,18 @@ package org.apache.geode.cache.client.internal;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 
+import java.io.IOException;
+
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.internal.cache.tier.MessageType;
+import org.apache.geode.internal.cache.tier.sockets.ChunkedMessage;
 import org.apache.geode.internal.cache.tier.sockets.Message;
 import org.apache.geode.test.junit.categories.ClientServerTest;
 
@@ -37,4 +43,39 @@ public class AbstractOpTest {
 assertThat(mockAbstractOp.processObjResponse(mock(Message.class), 
"string"))
 .isEqualTo(mockObject);
   }
+
+  @Test(expected = IOException.class)
+  public void processChunkedResponseShouldThrowIOExceptionWhenSocketBroken() 
throws Exception {
+ChunkedMessage msg = mock(ChunkedMessage.class);
+AbstractOp abstractOp = new AbstractOp(MessageType.PING, 0) {
+  @Override
+  protected Object processResponse(Message msg) throws Exception {
+return null;
+  }
+
+  @Override
+  protected boolean isErrorResponse(int msgType) {
+return false;
+  }
+
+  @Override
+  protected long startAttempt(ConnectionStats stats) {
+return 0;
+  }
+
+  @Override
+  protected void endSendAttempt(ConnectionStats stats, long start) {
+
+  }
+
+  @Override
+  protected void endAttempt(ConnectionStats stats, long start) {
+
+  }
+};
+doNothing().when(msg).readHeader();
+when(msg.getMessageType()).thenReturn(MessageType.PING);
+abstractOp = spy(abstractOp);
+abstractOp.processChunkedResponse(msg, "removeAll", null);
+  }
 }



[geode] branch feature/GEODE-8895 created (now 76b4f19)

2021-01-29 Thread zhouxj
This is an automated email from the ASF dual-hosted git repository.

zhouxj pushed a change to branch feature/GEODE-8895
in repository https://gitbox.apache.org/repos/asf/geode.git.


  at 76b4f19  GEODE-8895: processChunkResponse encountering broken socket 
should throw IOException to retrty

This branch includes the following new commits:

 new 76b4f19  GEODE-8895: processChunkResponse encountering broken socket 
should throw IOException to retrty

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[geode-native] branch develop updated: GEODE-8836: Fix incorrect schema location for cli tests (#721)

2021-01-29 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
 new 3450bac  GEODE-8836: Fix incorrect schema location for cli tests (#721)
3450bac is described below

commit 3450baca23d07259725c8ed3832d5ef6b781f1c5
Author: Michael Martell 
AuthorDate: Fri Jan 29 10:31:50 2021 -0800

GEODE-8836: Fix incorrect schema location for cli tests (#721)
---
 clicache/acceptance-test/cache.xml | 2 +-
 clicache/integration-test/cache.xml| 2 +-
 clicache/integration-test/cache_redundancy.xml | 2 +-
 clicache/integration-test/client_Loader.xml| 2 +-
 clicache/integration-test/client_generics_plugins.xml  | 2 +-
 clicache/integration-test/client_pdx.xml   | 2 +-
 clicache/integration-test/client_pool.xml  | 2 +-
 clicache/integration-test/invalid_cache1.xml   | 2 +-
 clicache/integration-test/invalid_cache2.xml   | 2 +-
 clicache/integration-test/invalid_cache3.xml   | 2 +-
 clicache/integration-test/invalid_cache_pool.xml   | 2 +-
 clicache/integration-test/invalid_cache_pool2.xml  | 2 +-
 clicache/integration-test/invalid_cache_pool3.xml  | 2 +-
 clicache/integration-test/invalid_cache_pool4.xml  | 2 +-
 clicache/integration-test/invalid_overflowAttr1.xml| 2 +-
 clicache/integration-test/invalid_overflowAttr2.xml| 2 +-
 clicache/integration-test/invalid_overflowAttr3.xml| 2 +-
 clicache/integration-test/valid_cache.xml  | 2 +-
 clicache/integration-test/valid_cache_refid.xml| 2 +-
 clicache/integration-test/valid_cache_region_refid.xml | 2 +-
 clicache/integration-test/valid_declarative_cache_creation.xml | 2 +-
 clicache/integration-test/valid_lruExpiration.xml  | 2 +-
 clicache/integration-test/valid_overflowAttr.xml   | 2 +-
 clicache/integration-test2/cache.xml   | 2 +-
 24 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/clicache/acceptance-test/cache.xml 
b/clicache/acceptance-test/cache.xml
index 9840108..c205f3d 100644
--- a/clicache/acceptance-test/cache.xml
+++ b/clicache/acceptance-test/cache.xml
@@ -19,7 +19,7 @@
 xmlns="http://geode.apache.org/schema/cache;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://geode.apache.org/schema/cache
-http://geode.apache.org/schema/cache/cpp-cache-1.0.xsd;
+
http://geode.apache.org/schema/cpp-cache/cpp-cache-1.0.xsd;
 version="9.0">
 
   
diff --git a/clicache/integration-test/cache.xml 
b/clicache/integration-test/cache.xml
index d5f17bf..133e380 100644
--- a/clicache/integration-test/cache.xml
+++ b/clicache/integration-test/cache.xml
@@ -21,7 +21,7 @@
 xmlns="http://geode.apache.org/schema/cache;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://geode.apache.org/schema/cache
-http://geode.apache.org/schema/cache/cpp-cache-1.0.xsd;
+
http://geode.apache.org/schema/cpp-cache/cpp-cache-1.0.xsd;
 version="9.0">
 
 
diff --git a/clicache/integration-test/cache_redundancy.xml 
b/clicache/integration-test/cache_redundancy.xml
index 5eafda4..d8a1efe 100644
--- a/clicache/integration-test/cache_redundancy.xml
+++ b/clicache/integration-test/cache_redundancy.xml
@@ -23,7 +23,7 @@
 xmlns="http://geode.apache.org/schema/cache;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://geode.apache.org/schema/cache
-http://geode.apache.org/schema/cache/cpp-cache-1.0.xsd;
+
http://geode.apache.org/schema/cpp-cache/cpp-cache-1.0.xsd;
 version="9.0"
 redundancy-level="1"
 endpoints="localhost:HOST_PORT1,localhost:HOST_PORT2" >
diff --git a/clicache/integration-test/client_Loader.xml 
b/clicache/integration-test/client_Loader.xml
index 53a17cf..04e157e 100644
--- a/clicache/integration-test/client_Loader.xml
+++ b/clicache/integration-test/client_Loader.xml
@@ -23,7 +23,7 @@
 xmlns="http://geode.apache.org/schema/cache;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://geode.apache.org/schema/cache
-http://geode.apache.org/schema/cache/cpp-cache-1.0.xsd;
+
http://geode.apache.org/schema/cpp-cache/cpp-cache-1.0.xsd;
 version="9.0">
 
 
diff --git a/clicache/integration-test/client_generics_plugins.xml 
b/clicache/integration-test/client_generics_plugins.xml
index 89a7439..6f1fb8c 100644
--- 

[geode-native] branch develop updated: Update to ace 7 (#732)

2021-01-29 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
 new c655c68  Update to ace 7 (#732)
c655c68 is described below

commit c655c685361397f9974fc391a3411b21ba14d737
Author: M. Oleske 
AuthorDate: Fri Jan 29 10:29:37 2021 -0800

Update to ace 7 (#732)

Authored-by: M. Oleske 
---
 dependencies/ACE/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dependencies/ACE/CMakeLists.txt b/dependencies/ACE/CMakeLists.txt
index 6e90b40..86287de 100644
--- a/dependencies/ACE/CMakeLists.txt
+++ b/dependencies/ACE/CMakeLists.txt
@@ -13,9 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-project( ACE VERSION 6.5.12 LANGUAGES NONE )
+project( ACE VERSION 7.0.0 LANGUAGES NONE )
 
-set( SHA256 de96c68a6262d6b9ba76b5057c02c7e6964c070b1328a63bf70259e9530a7996 )
+set( SHA256 9dfdc31664bc2faf7832e50197203fe274c661a56f17b18af2b227ddb34174be )
 
 if ("SunOS" STREQUAL ${CMAKE_SYSTEM_NAME})
   set( ACE_PLATFORM sunos5_sunc++ )



[geode-native] branch develop updated: GEODE-8871: parse server response messages for PUT and CONTAINS_KEY (#730)

2021-01-29 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
 new 6391584  GEODE-8871: parse server response messages for PUT and 
CONTAINS_KEY (#730)
6391584 is described below

commit 6391584c195a85714fff62cfa1e0c1d0ea6de6aa
Author: Blake Bender 
AuthorDate: Fri Jan 29 10:26:11 2021 -0800

GEODE-8871: parse server response messages for PUT and CONTAINS_KEY (#730)

- parse server response messages for PUT and CONTAINS_KEY
- Fix bad regex (copy/paste error)
- Also some formatting fixes
---
 tools/gnmsg/client_message_decoder.py  | 17 +++-
 tools/gnmsg/client_messages.py | 17 +++-
 tools/gnmsg/command_line.py|  4 +-
 tools/gnmsg/gnmsg.py   |  4 +-
 .../{numeric_conversion.py => gnmsg_globals.py}| 24 ++
 tools/gnmsg/numeric_conversion.py  |  6 ++
 .../{numeric_conversion.py => protocol_state.py}   | 32 
 tools/gnmsg/read_values.py | 12 ++-
 tools/gnmsg/server_message_decoder.py  | 37 +
 tools/gnmsg/server_messages.py | 91 +-
 10 files changed, 177 insertions(+), 67 deletions(-)

diff --git a/tools/gnmsg/client_message_decoder.py 
b/tools/gnmsg/client_message_decoder.py
index 4631747..0c1aaa9 100644
--- a/tools/gnmsg/client_message_decoder.py
+++ b/tools/gnmsg/client_message_decoder.py
@@ -22,6 +22,7 @@ from client_messages import parse_client_message
 from decoder_base import DecoderBase
 from message_types import message_types
 from numeric_conversion import to_hex_digit
+from gnmsg_globals import global_protocol_state
 
 
 class ClientMessageDecoder(DecoderBase):
@@ -84,12 +85,13 @@ class ClientMessageDecoder(DecoderBase):
 "PERIODIC_ACK",
 "PING",
 "REQUEST_EVENT_VALUE",
-"ROLLBACK"
+"ROLLBACK",
 "SIZE",
 "TX_FAILOVER",
 "TX_SYNCHRONIZATION",
 "USER_CREDENTIAL_MESSAGE",
 ]
+
 def search_for_version(self, line):
 if self.nc_version_ == None:
 expression = re.compile(r"Product version:.*Native 
(\d+)\.(\d+)\.(\d+)-")
@@ -218,7 +220,12 @@ class ClientMessageDecoder(DecoderBase):
 
 parts = []
 if self.get_send_trace_parts(line, parts):
-send_trace["Timestamp"], send_trace["tid"], 
send_trace["Connection"], message_bytes = parts
+(
+send_trace["Timestamp"],
+send_trace["tid"],
+send_trace["Connection"],
+message_bytes,
+) = parts
 is_send_trace = True
 elif self.get_add_security_trace_parts(line, parts):
 timestamp, tid, connection, security_footer_length, message_bytes 
= parts
@@ -250,6 +257,9 @@ class ClientMessageDecoder(DecoderBase):
 
 parse_client_message(send_trace, message_bytes)
 self.output_queue_.put({"message": send_trace})
+global_protocol_state.set_last_client_message(
+send_trace["tid"], send_trace["Type"]
+)
 elif self.connection_states_[connection] == 
self.STATE_FOUND_SECURITY_FOOTER_:
 if is_send_trace:
 send_trace["Direction"] = "--->"
@@ -261,3 +271,6 @@ class ClientMessageDecoder(DecoderBase):
 send_trace["SecurityFlag"],
 ) = self.parse_request_fields(message_bytes)
 self.output_queue_.put({"message": send_trace})
+global_protocol_state.set_last_client_message(
+send_trace["tid"], send_trace["Type"]
+)
diff --git a/tools/gnmsg/client_messages.py b/tools/gnmsg/client_messages.py
index a6f03ae..c4bb65c 100644
--- a/tools/gnmsg/client_messages.py
+++ b/tools/gnmsg/client_messages.py
@@ -382,20 +382,27 @@ def read_execute_function_message(properties, 
message_bytes, offset):
 (properties["FunctionName"], offset) = parse_region_part(message_bytes, 
offset)
 (properties["Arguments"], offset) = parse_object_part(message_bytes, 
offset)
 
+
 def parse_getall_optional_callback_arguments(message_bytes, offset):
 (local_object, local_offset) = parse_object_part(message_bytes, offset)
-if (local_object["IsObject"] == 0):
+if local_object["IsObject"] == 0:
 (local_object, local_offset) = parse_raw_int_part(message_bytes, 
offset)
 return (local_object, local_offset)
 
+
 def read_get_all_70_message(properties, message_bytes, offset):
 (properties["Region"], offset) = parse_region_part(message_bytes, offset)
 (properties["KeyList"], offset) = parse_key_or_value(message_bytes, offset)
-(properties["CallbackArguments"], offset) = 

[geode-native] branch develop updated: GEODE-8887: Refactor EventIdTSS class (#733)

2021-01-29 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
 new 78d2fbf  GEODE-8887: Refactor EventIdTSS class (#733)
78d2fbf is described below

commit 78d2fbf67e81152b1a61a4ac411a30121e9f87ce
Author: Blake Bender 
AuthorDate: Fri Jan 29 10:15:56 2021 -0800

GEODE-8887: Refactor EventIdTSS class (#733)

- Use Meyers singleton pattern for global singleton (threadId), and
  thread local singleton EventIdTSS
- rename all member variables in EventId and EventIdTSS classes
- clean up logic slightly around global threadId atomic var
- rename EventId getter methods for clarity
---
 cppcache/src/EventId.cpp| 140 +++-
 cppcache/src/EventId.hpp|  30 ++
 cppcache/src/EventIdMap.cpp |   4 +-
 3 files changed, 105 insertions(+), 69 deletions(-)

diff --git a/cppcache/src/EventId.cpp b/cppcache/src/EventId.cpp
index a6db548..62c0539 100644
--- a/cppcache/src/EventId.cpp
+++ b/cppcache/src/EventId.cpp
@@ -17,82 +17,97 @@
 #include "EventId.hpp"
 
 #include 
+#include 
 #include 
 
 #include 
 
 #include "ClientProxyMembershipID.hpp"
+#include "util/Log.hpp"
 
 namespace apache {
 namespace geode {
 namespace client {
 
-class EventIdTSS {
- private:
-  static std::atomic s_eidThrId;
-
-  int64_t m_eidThrTSS;
-  int64_t m_eidSeqTSS;
+class ThreadIdCounter {
+ public:
+  static std::atomic& instance() {
+static std::atomic threadId_(0);
+return threadId_;
+  }
 
-  ~EventIdTSS() = default;
-  EventIdTSS(const EventIdTSS&) = delete;
-  EventIdTSS& operator=(const EventIdTSS&) = delete;
+  static int64_t next() { return ++instance(); }
+};
 
+class EventIdTSS {
  public:
-  // this should get called just once per thread due to first access to TSS
-  EventIdTSS() {
-m_eidThrTSS = ++s_eidThrId;
-m_eidSeqTSS = 0;
+  static EventIdTSS& instance() {
+thread_local EventIdTSS eventId_;
+return eventId_;
   }
 
-  inline int64_t getEidThr() { return m_eidThrTSS; }
+  int64_t nextSequenceId() {
+sequenceId_++;
+return sequenceId_;
+  }
 
-  inline int64_t getAndIncEidSeq() { return m_eidSeqTSS++; }
+  int64_t currentSequenceId() { return sequenceId_; }
 
-  inline int64_t getSeqNum() { return m_eidSeqTSS - 1; }
+  int64_t threadId() { return threadId_; }
 
-  static thread_local EventIdTSS s_eventId;
+ private:
+  EventIdTSS();
 
-};  // class EventIdTSS
+  int64_t threadId_;
+  int64_t sequenceId_;
+};
 
-std::atomic EventIdTSS::s_eidThrId;
-thread_local EventIdTSS EventIdTSS::s_eventId;
+EventIdTSS::EventIdTSS() : threadId_(ThreadIdCounter::next()), sequenceId_(0) {
+  LOGDEBUG("EventIdTSS::EventIdTSS(%p): threadId_=%" PRId64
+   ", sequenceId_=%" PRId64,
+   this, threadId_, sequenceId_);
+}
 
 void EventId::toData(DataOutput& output) const {
   //  This method is always expected to write out nonstatic distributed
-  //  memberid.
-  output.writeBytes(reinterpret_cast(m_eidMem), m_eidMemLen);
+  //  memberid.  Note that binary representation of EventId is NOT THE
+  //  SAME here as when serialized into part of a message (via the writeIdsData
+  //  method).
+  LOGDEBUG("EventId::toData(%p) - called", this);
+  output.writeBytes(reinterpret_cast(clientId_),
+clientIdLength_);
   output.writeArrayLen(18);
   char longCode = 3;
   output.write(static_cast(longCode));
-  output.writeInt(m_eidThr);
+  output.writeInt(threadId_);
   output.write(static_cast(longCode));
-  output.writeInt(m_eidSeq);
-  output.writeInt(m_bucketId);
-  output.write(m_breadcrumbCounter);
+  output.writeInt(sequenceId_);
+  output.writeInt(bucketId_);
+  output.write(breadcrumbCounter_);
 }
 
 void EventId::fromData(DataInput& input) {
-  // TODO: statics being assigned; not thread-safe??
-  m_eidMemLen = input.readArrayLength();
-  input.readBytesOnly(reinterpret_cast(m_eidMem), m_eidMemLen);
-  input.readArrayLength();  // ignore arrayLen
-  m_eidThr = getEventIdData(input, input.read());
-  m_eidSeq = getEventIdData(input, input.read());
-  m_bucketId = input.readInt32();
-  m_breadcrumbCounter = input.read();
+  LOGDEBUG("EventId::fromData(%p) - called", this);
+  clientIdLength_ = input.readArrayLength();
+  input.readBytesOnly(reinterpret_cast(clientId_), clientIdLength_);
+  input.readArrayLength();
+  threadId_ = getEventIdData(input, input.read());
+  sequenceId_ = getEventIdData(input, input.read());
+  bucketId_ = input.readInt32();
+  breadcrumbCounter_ = input.read();
 }
 
-const char* EventId::getMemId() const { return m_eidMem; }
+const char* EventId::clientId() const { return clientId_; }
 
-int32_t EventId::getMemIdLen() const { return m_eidMemLen; }
+int32_t EventId::clientIdLength() const { return clientIdLength_; }
 
-int64_t EventId::getThrId() const { return m_eidThr; }
+int64_t 

[geode] branch master updated: Enable require_code_owner_reviews: true via .asf.yaml (#5971)

2021-01-29 Thread rhoughton
This is an automated email from the ASF dual-hosted git repository.

rhoughton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/master by this push:
 new f6f20ef  Enable require_code_owner_reviews: true via .asf.yaml (#5971)
f6f20ef is described below

commit f6f20ef6f31e912ba2b53eb9c52f56eb7ee774a8
Author: Robert Houghton 
AuthorDate: Thu Jan 28 16:22:27 2021 -0800

Enable require_code_owner_reviews: true via .asf.yaml (#5971)

* Enable require_code_owner_reviews: true via .asf.yaml

(cherry picked from commit b07670a23c3e10aa6f6746d78d1393ddf80d7931)
---
 .asf.yaml | 43 +++
 1 file changed, 43 insertions(+)

diff --git a/.asf.yaml b/.asf.yaml
index 003d459..4368159 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -7,6 +7,49 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+github:
+  description: "Apache Geode"
+  homepage: https://geode.apache.org/
+  labels:
+- geode
+- datagrid
+- apache
+  features:
+# To enable wiki for documentation
+wiki: false
+# To enable issue management
+issues: false
+# To enable projects for project management boards
+projects: true
+
+  enabled_merge_buttons:
+# enable squash button:
+squash:  true
+# enable merge button:
+merge:  true
+# enable rebase button:
+rebase:  true
+
+  protected_branches:
+develop:
+  required_status_checks:
+# strict means "Require branches to be up to date before merging".
+strict: false
+# contexts are the names of checks that must pass
+contexts:
+  - concourse-ci/ApiCheckTestOpenJDK11
+  - concourse-ci/Build
+  - concourse-ci/StressNewTestOpenJDK11
+  - concourse-ci/UnitTestOpenJDK11
+  - concourse-ci/UnitTestOpenJDK8
+
+  required_pull_request_reviews:
+dismiss_stale_reviews: false
+require_code_owner_reviews: true
+required_approving_review_count: 1
+
+  required_signatures: false
+
 notifications:
 commits: commits@geode.apache.org
 issues: iss...@geode.apache.org



[geode] branch support/1.12 updated: GEODE-8873: Do not log stack trace for Exception in MessageDispatcher

2021-01-29 Thread donalevans
This is an automated email from the ASF dual-hosted git repository.

donalevans pushed a commit to branch support/1.12
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.12 by this push:
 new df07af4  GEODE-8873: Do not log stack trace for Exception in 
MessageDispatcher
df07af4 is described below

commit df07af4c2e27c384b56c78e721c8f8e3e0e61c3f
Author: Donal Evans 
AuthorDate: Mon Jan 25 16:39:43 2021 -0800

GEODE-8873: Do not log stack trace for Exception in MessageDispatcher

Authored-by: Donal Evans 
(cherry picked from commit 07389149efad9aff18da888b1828639468a884b5)
---
 .../cache/tier/sockets/CacheClientProxy.java   | 52 --
 1 file changed, 19 insertions(+), 33 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
index c7f14f0..90bac44 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
@@ -18,6 +18,7 @@ import java.io.IOException;
 import java.net.Socket;
 import java.net.SocketException;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Date;
@@ -2573,13 +2574,13 @@ public class CacheClientProxy implements ClientSession {
   }
 
   // Processing gets here if isStopped=true. What is this code below doing?
-  List list = null;
   if (!exceptionOccurred) {
+List list = new ArrayList<>();
 try {
   // Clear the interrupt status if any,
   Thread.interrupted();
-  int size = this._messageQueue.size();
-  list = this._messageQueue.peek(size);
+  int size = _messageQueue.size();
+  list.addAll(_messageQueue.peek(size));
   if (logger.isDebugEnabled()) {
 logger.debug(
 "{}: After flagging the dispatcher to stop , the residual List 
of messages to be dispatched={} size={}",
@@ -2587,53 +2588,38 @@ public class CacheClientProxy implements ClientSession {
   }
   if (list.size() > 0) {
 long start = getStatistics().startTime();
-Iterator itr = list.iterator();
+Iterator itr = list.iterator();
 while (itr.hasNext()) {
-  dispatchMessage((ClientMessage) itr.next());
+  dispatchMessage(itr.next());
   getStatistics().endMessage(start);
-  // @todo asif: shouldn't we call itr.remove() since the current 
msg
-  // has been sent? That way list will be more accurate
-  // if we have an exception.
+  itr.remove();
 }
-this._messageQueue.remove();
+_messageQueue.remove();
   }
 } catch (CancelException e) {
   if (logger.isDebugEnabled()) {
 logger.debug("CacheClientNotifier stopped due to cancellation");
   }
-} catch (Exception ignore) {
-  // if (logger.isInfoEnabled()) {
+} catch (Exception e) {
   String extraMsg = null;
 
-  if ("Broken pipe".equals(ignore.getMessage())) {
+  if ("Broken pipe".equals(e.getMessage())) {
 extraMsg = "Problem caused by broken pipe on socket.";
-  } else if (ignore instanceof RegionDestroyedException) {
-extraMsg =
-"Problem caused by message queue being closed.";
+  } else if (e instanceof RegionDestroyedException) {
+extraMsg = "Problem caused by message queue being closed.";
   }
-  final Object[] msgArgs = new Object[] {((!isStopped()) ? 
this.toString() + ": " : ""),
-  ((list == null) ? 0 : list.size())};
-  if (extraMsg != null) {
-// Dont print exception details, but add on extraMsg
-logger.info(
-String.format(
-"%s Possibility of not being able to send some or all of 
the messages to clients. Total messages currently present in the list %s.",
-msgArgs));
-logger.info(extraMsg);
-  } else {
-// Print full stacktrace
-logger.info(String.format(
-"%s Possibility of not being able to send some or all of the 
messages to clients. Total messages currently present in the list %s.",
-msgArgs),
-ignore);
+  if (extraMsg == null) {
+extraMsg = "Problem caused by: " + e.getMessage();
   }
+  logger.info(String.format(
+  "%s Possibility of not being able to send some or all of the 
messages to clients. Total messages currently present in the list %s.",
+  

[geode] branch support/1.13 updated: GEODE-8873: Do not log stack trace for Exception in MessageDispatcher

2021-01-29 Thread donalevans
This is an automated email from the ASF dual-hosted git repository.

donalevans pushed a commit to branch support/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.13 by this push:
 new b2c2b01  GEODE-8873: Do not log stack trace for Exception in 
MessageDispatcher
b2c2b01 is described below

commit b2c2b016bc4cac1a835c61ccc090898c784f64ca
Author: Donal Evans 
AuthorDate: Thu Jan 28 17:01:46 2021 -0800

GEODE-8873: Do not log stack trace for Exception in MessageDispatcher

Authored-by: Donal Evans 
(cherry picked from commit 07389149efad9aff18da888b1828639468a884b5)
---
 .../cache/tier/sockets/MessageDispatcher.java  | 49 +-
 1 file changed, 19 insertions(+), 30 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java
index 899b182..cbdbaa8 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java
@@ -14,9 +14,12 @@
  */
 package org.apache.geode.internal.cache.tier.sockets;
 
+import static org.apache.geode.util.internal.UncheckedUtils.uncheckedCast;
+
 import java.io.IOException;
 import java.net.Socket;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
@@ -468,13 +471,13 @@ public class MessageDispatcher extends LoggingThread {
 }
 
 // Processing gets here if isStopped=true. What is this code below doing?
-List list = null;
 if (!exceptionOccurred) {
+  List list = new ArrayList<>();
   try {
 // Clear the interrupt status if any,
 Thread.interrupted();
-int size = this._messageQueue.size();
-list = this._messageQueue.peek(size);
+int size = _messageQueue.size();
+list.addAll(uncheckedCast(_messageQueue.peek(size)));
 if (logger.isDebugEnabled()) {
   logger.debug(
   "{}: After flagging the dispatcher to stop , the residual List 
of messages to be dispatched={} size={}",
@@ -482,13 +485,11 @@ public class MessageDispatcher extends LoggingThread {
 }
 if (list.size() > 0) {
   long start = getStatistics().startTime();
-  Iterator itr = list.iterator();
+  Iterator itr = list.iterator();
   while (itr.hasNext()) {
-dispatchMessage((ClientMessage) itr.next());
+dispatchMessage(itr.next());
 getStatistics().endMessage(start);
-// @todo asif: shouldn't we call itr.remove() since the current msg
-// has been sent? That way list will be more accurate
-// if we have an exception.
+itr.remove();
   }
   this._messageQueue.remove();
 }
@@ -496,39 +497,27 @@ public class MessageDispatcher extends LoggingThread {
 if (logger.isDebugEnabled()) {
   logger.debug("CacheClientNotifier stopped due to cancellation");
 }
-  } catch (Exception ignore) {
-// if (logger.isInfoEnabled()) {
+  } catch (Exception e) {
 String extraMsg = null;
 
-if ("Broken pipe".equals(ignore.getMessage())) {
+if ("Broken pipe".equals(e.getMessage())) {
   extraMsg = "Problem caused by broken pipe on socket.";
-} else if (ignore instanceof RegionDestroyedException) {
+} else if (e instanceof RegionDestroyedException) {
   extraMsg =
   "Problem caused by message queue being closed.";
 }
-final Object[] msgArgs = new Object[] {((!isStopped()) ? 
this.toString() + ": " : ""),
-((list == null) ? 0 : list.size())};
-if (extraMsg != null) {
-  // Dont print exception details, but add on extraMsg
-  logger.info(
-  String.format(
-  "%s Possibility of not being able to send some or all of the 
messages to clients. Total messages currently present in the list %s.",
-  msgArgs));
-  logger.info(extraMsg);
-} else {
-  // Print full stacktrace
-  logger.info(String.format(
-  "%s Possibility of not being able to send some or all of the 
messages to clients. Total messages currently present in the list %s.",
-  msgArgs),
-  ignore);
+if (extraMsg == null) {
+  extraMsg = "Problem caused by: " + e.getMessage();
 }
+logger.info(String.format(
+"%s Possibility of not being able to send some or all of the 
messages to clients. Total messages currently present in the list %s.",
+(!isStopped()) ? toString() + ": " : "", list.size()));
+logger.info(extraMsg);
   }
 

[geode] branch develop updated (f3f07a0 -> 6d54375)

2021-01-29 Thread heybales
This is an automated email from the ASF dual-hosted git repository.

heybales pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git.


from f3f07a0  GEODE-8767: NullPointerException in TCPConduit.getBufferPool 
due to conTable being null (#5962)
 add 6d54375  GEODE-8879: add error messages for internal commands (#5965)

No new revisions were added by this update.

Summary of changes:
 .../executor/AbstractUnknownIntegrationTest.java | 20 
 .../geode/redis/internal/RedisCommandType.java   |  6 +++---
 2 files changed, 23 insertions(+), 3 deletions(-)



[geode] branch develop updated: GEODE-8767: NullPointerException in TCPConduit.getBufferPool due to conTable being null (#5962)

2021-01-29 Thread bschuchardt
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
 new f3f07a0  GEODE-8767: NullPointerException in TCPConduit.getBufferPool 
due to conTable being null (#5962)
f3f07a0 is described below

commit f3f07a006c30f54fd4ae84309c4c4ede4af22f36
Author: Bruce Schuchardt 
AuthorDate: Fri Jan 29 08:07:17 2021 -0800

GEODE-8767: NullPointerException in TCPConduit.getBufferPool due to 
conTable being null (#5962)

A NPE was being thrown in TCPConduit.getBufferPool() because the conTable 
instance
variable is nulled out when the TCPConduit is stopped.  This commit
moves the buffer pool from TCPConduit's conTable object up to the enclosing
DirectChannel object.  This removes the need for DirectChannel to ask
TCPConduit for the buffer pool.
---
 .../distributed/internal/direct/DirectChannel.java | 22 ++-
 .../apache/geode/internal/tcp/ConnectionTable.java |  2 +-
 .../org/apache/geode/internal/tcp/TCPConduit.java  | 11 +---
 .../apache/geode/internal/tcp/TCPConduitTest.java  | 31 +-
 4 files changed, 48 insertions(+), 18 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
index c195655..fc8800f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
@@ -49,6 +49,7 @@ import 
org.apache.geode.distributed.internal.membership.api.MessageListener;
 import org.apache.geode.internal.cache.DirectReplyMessage;
 import org.apache.geode.internal.inet.LocalHostUtil;
 import org.apache.geode.internal.logging.log4j.LogMarker;
+import org.apache.geode.internal.net.BufferPool;
 import org.apache.geode.internal.tcp.BaseMsgStreamer;
 import org.apache.geode.internal.tcp.ConnectExceptions;
 import org.apache.geode.internal.tcp.Connection;
@@ -71,6 +72,8 @@ public class DirectChannel {
   /** this is the conduit used for communications */
   private final transient TCPConduit conduit;
   private final ClusterDistributionManager dm;
+  private final DMStats stats;
+  private final BufferPool bufferPool;
 
   private volatile boolean disconnected = true;
 
@@ -112,6 +115,8 @@ public class DirectChannel {
   throws ConnectionException {
 this.receiver = listener;
 this.dm = dm;
+this.stats = dm.getStats();
+this.bufferPool = new BufferPool(stats);
 
 DistributionConfig dc = dm.getConfig();
 this.address = initAddress(dc);
@@ -137,7 +142,7 @@ public class DirectChannel {
   props.setProperty("membership_port_range_start", "" + range[0]);
   props.setProperty("membership_port_range_end", "" + range[1]);
 
-  this.conduit = new TCPConduit(mgr, port, address, isBindAddress, this, 
props);
+  this.conduit = new TCPConduit(mgr, port, address, isBindAddress, this, 
bufferPool, props);
   disconnected = false;
   disconnectCompleted = false;
   logger.info("GemFire P2P Listener started on {}",
@@ -184,6 +189,13 @@ public class DirectChannel {
 
 
   /**
+   * Returns the buffer pool used for direct-memory byte buffers in this 
DirectChannel
+   */
+  public BufferPool getBufferPool() {
+return bufferPool;
+  }
+
+  /**
* Sends a msg to a list of destinations. This code does some special 
optimizations to stream
* large messages
*
@@ -295,7 +307,7 @@ public class DirectChannel {
 List sentCons; // used for cons we sent to this time
 
 final BaseMsgStreamer ms =
-MsgStreamer.create(cons, msg, directReply, stats, 
getConduit().getBufferPool());
+MsgStreamer.create(cons, msg, directReply, stats, bufferPool);
 try {
   startTime = 0;
   if (ackTimeout > 0) {
@@ -520,11 +532,7 @@ public class DirectChannel {
* Returns null if no stats available.
*/
   public DMStats getDMStats() {
-if (dm != null) {
-  return dm.getStats(); // fix for bug#34004
-} else {
-  return null;
-}
+return stats;
   }
 
   /**
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java 
b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
index df9a4a5..614b502 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
@@ -207,7 +207,7 @@ public class ConnectionTable {
 threadConnectionMap = new ConcurrentHashMap();
 p2pReaderThreadPool = 
createThreadPoolForIO(conduit.getDM().getSystem().isShareSockets());
 socketCloser = new SocketCloser();
-bufferPool = new