This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ratis.git
The following commit(s) were added to refs/heads/master by this push:
new e1e446f RATIS-1232. Change error log message in initGroups (#349).
Contributed by Bharat Viswanadham
e1e446f is described below
commit e1e446f6340e9ac09a6c7d01c1c080bf250e03fa
Author: Bharat Viswanadham <[email protected]>
AuthorDate: Fri Dec 11 02:03:18 2020 -0800
RATIS-1232. Change error log message in initGroups (#349). Contributed by
Bharat Viswanadham
---
.../java/org/apache/ratis/server/impl/RaftServerProxy.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git
a/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java
b/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java
index 53fcaf8..80bfa6d 100644
---
a/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java
+++
b/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java
@@ -231,9 +231,17 @@ class RaftServerProxy implements RaftServer {
.forEach(sub -> {
try {
LOG.info("{}: found a subdirectory {}", getId(), sub);
- final RaftGroupId groupId =
RaftGroupId.valueOf(UUID.fromString(sub.getName()));
- if (!raftGroupId.filter(groupId::equals).isPresent()) {
- addGroup(RaftGroup.valueOf(groupId));
+ RaftGroupId groupId = null;
+ try {
+ groupId =
RaftGroupId.valueOf(UUID.fromString(sub.getName()));
+ } catch (Exception e) {
+ LOG.info("{}: The directory {} is not a group directory;" +
+ " ignoring it. ", getId(), sub.getAbsolutePath());
+ }
+ if (groupId != null) {
+ if (!raftGroupId.filter(groupId::equals).isPresent()) {
+ addGroup(RaftGroup.valueOf(groupId));
+ }
}
} catch (Exception e) {
LOG.warn(getId() + ": Failed to initialize the group directory
"