-
Notifications
You must be signed in to change notification settings - Fork 525
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
Changes from 1 commit
d6a32da
a4d7b2e
b43b699
431f5bc
2836392
bba8e75
f2cc09c
2b953b9
b10030b
7fdbbd5
c354121
c1dc32b
eec6ae2
14a7e6d
3c78da1
ce81669
fd508d6
b1660b7
d2747a6
e2a3bad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,22 +250,39 @@ public static synchronized ServerOptions instance() { | |
"0.0.0.0" | ||
); | ||
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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename to client_connect_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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add space |
||
.setReconnectPeriod(conf.get( | ||
ServerOptions.CLIENT_RECONNECTION_TIMEOUT) *1000) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ public class SofaRpcServer { | |
|
||
private Map<String, ProviderConfig> providerConfigs; | ||
private ServerConfig serverConfig; | ||
private final int rpcServerTimeout; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)) { | ||
|
@@ -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() { | ||
|
@@ -63,6 +65,7 @@ public void exportAll() { | |
} | ||
for (ProviderConfig providerConfig : this.providerConfigs.values()) { | ||
providerConfig.setServer(this.serverConfig); | ||
providerConfig.setTimeout(this.rpcServerTimeout); | ||
providerConfig.export(); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move |
||
rpc.client_connection_timeout=8000 | ||
rpc.client_read_timeout=8000 | ||
rpc.server_timeout=30 | ||
rpc.client_connection_timeout=20 | ||
rpc.client_reconnection_timeout=20 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
There was a problem hiding this comment.
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