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 6e9db1a RATIS-1135. Initialize DataStreamServer after RaftServerProxy
id is set (#260). Contributed by Rui Wang
6e9db1a is described below
commit 6e9db1a92263e9a1f28eb644436df4d683f5ace8
Author: Rui Wang <[email protected]>
AuthorDate: Fri Nov 6 19:27:05 2020 -0800
RATIS-1135. Initialize DataStreamServer after RaftServerProxy id is set
(#260). Contributed by Rui Wang
---
.../src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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 4924927..14dc429 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
@@ -180,9 +180,11 @@ public class RaftServerProxy implements RaftServer {
this.factory = ServerFactory.cast(rpcType.newFactory(parameters));
this.serverRpc = factory.newRaftServerRpc(this);
- this.dataStreamServerRpc = new DataStreamServerImpl(this,
parameters).getServerRpc();
this.id = id != null? id: RaftPeerId.valueOf(getIdStringFrom(serverRpc));
+
+ this.dataStreamServerRpc = new DataStreamServerImpl(this,
parameters).getServerRpc();
+
this.lifeCycle = new LifeCycle(this.id + "-" + getClass().getSimpleName());
this.implExecutor = Executors.newSingleThreadExecutor();