Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-node auth information sharing function #1350

Merged
merged 20 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -250,22 +250,39 @@ public static synchronized ServerOptions instance() {
"0.0.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set default value 127.0.0.1

);
javeme marked this conversation as resolved.
Show resolved Hide resolved

public static final ConfigOption<Integer> RPC_CLIENT_CONNECTION_TIMEOUT =
public static final ConfigOption<Integer> RPC_SERVER_TIMEOUT =
new ConfigOption<>(
"rpc.server_timeout",
"The timeout(in seconds) of rpc server execution.",
rangeInt(1, Integer.MAX_VALUE),
30
);

public static final ConfigOption<Integer> CLIENT_CONNECTION_TIMEOUT =
new ConfigOption<>(
"rpc.client_connection_timeout",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to client_connect_timeout
and add client_reconnect_timeout

"The timeout(in seconds) of rpc client connect to rpc " +
"server.",
rangeInt(1, Integer.MAX_VALUE),
8000
20
);

public static final ConfigOption<Integer> CLIENT_RECONNECTION_TIMEOUT =
new ConfigOption<>(
"rpc.client_reconnection_timeout",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client_connect_timeout and client_reconnect_timeout, not connection

"The timeout(in seconds) of rpc client reconnect to rpc " +
"server.",
rangeInt(1, Integer.MAX_VALUE),
20
);
javeme marked this conversation as resolved.
Show resolved Hide resolved

public static final ConfigOption<Integer> RPC_CLIENT_READ_TIMEOUT =
public static final ConfigOption<Integer> CLIENT_READ_TIMEOUT =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

new ConfigOption<>(
"rpc.client_read_timeout",
"The timeout(in seconds) of rpc client read from rpc " +
"server.",
rangeInt(1, Integer.MAX_VALUE),
8000
40
);

public static final ConfigOption<Integer> RPC_CLIENT_RETRIES =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public <T> void addConsumerConfig(Class<T> clazz, HugeConfig conf) {
.setInterfaceId(clazz.getName())
.setProtocol(conf.get(ServerOptions.RPC_PROTOCOL))
.setDirectUrl(conf.get(ServerOptions.AUTH_REMOTE_URL))
.setTimeout(conf.get(ServerOptions.RPC_CLIENT_READ_TIMEOUT))
.setTimeout(conf.get(ServerOptions.CLIENT_READ_TIMEOUT)*1000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space

.setConnectTimeout(conf.get(
ServerOptions.RPC_CLIENT_CONNECTION_TIMEOUT))
ServerOptions.CLIENT_CONNECTION_TIMEOUT)*1000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space

.setReconnectPeriod(conf.get(
ServerOptions.CLIENT_RECONNECTION_TIMEOUT) *1000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space

.setRetries(conf.get(ServerOptions.RPC_CLIENT_RETRIES))
.setLoadBalancer(conf.get(
ServerOptions.RPC_CLIENT_LOAD_BALANCER));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class SofaRpcServer {

private Map<String, ProviderConfig> providerConfigs;
private ServerConfig serverConfig;
private final int rpcServerTimeout;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also set final for serverConfig and providerConfigs


static {
if (RpcConfigs.getOrDefaultValue(RpcOptions.JVM_SHUTDOWN_HOOK, true)) {
Expand All @@ -54,6 +55,7 @@ public SofaRpcServer(HugeConfig conf, RpcProviderConfig providerConfig) {
.setHost(conf.get(ServerOptions.RPC_SERVER_HOST))
.setDaemon(false);
this.providerConfigs = providerConfig.providerConfigs();
this.rpcServerTimeout = conf.get(ServerOptions.RPC_SERVER_TIMEOUT)*1000;
}

public void exportAll() {
Expand All @@ -63,6 +65,7 @@ public void exportAll() {
}
for (ProviderConfig providerConfig : this.providerConfigs.values()) {
providerConfig.setServer(this.serverConfig);
providerConfig.setTimeout(this.rpcServerTimeout);
providerConfig.export();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ server.role=master
#auth.remote_url=10.103.168.25:8899,10.103.168.25:8898,10.103.168.25:8897
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use 127.0.0.1 instead of test machine ip

rpc.server_port=8899
rpc.server_host=127.0.0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move server_host before server_host

rpc.client_connection_timeout=8000
rpc.client_read_timeout=8000
rpc.server_timeout=30
rpc.client_connection_timeout=20
rpc.client_reconnection_timeout=20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

rpc.client_read_timeout=40
rpc.client_retries=3
rpc.client_load_balancer=consistentHash
rpc.protocol=bolt