[
https://issues.apache.org/jira/browse/KNOX-2771?focusedWorklogId=788232&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-788232
]
ASF GitHub Bot logged work on KNOX-2771:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Jul/22 13:16
Start Date: 06/Jul/22 13:16
Worklog Time Spent: 10m
Work Description: smolnar82 commented on code in PR #602:
URL: https://github.com/apache/knox/pull/602#discussion_r914826235
##########
gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/DefaultHttpClientFactory.java:
##########
@@ -128,12 +128,14 @@ public HttpClient createHttpClient(FilterConfig
filterConfig) {
if (doesRetryParamExist(filterConfig)) {
int retryCount =
Integer.parseInt(filterConfig.getInitParameter(PARAMETER_RETRY_COUNT));
+ LOG.setRetryCount(retryCount, serviceRole);
/* do we want to retry non-idempotent requests? default no */
boolean retryNonIdempotent = DEFAULT_PARAMETER_RETRY_NON_SAFE_REQUEST;
if (filterConfig.getInitParameter(PARAMETER_RETRY_NON_SAFE_REQUEST)
!= null) {
retryNonIdempotent = Boolean.parseBoolean(
filterConfig.getInitParameter(PARAMETER_RETRY_NON_SAFE_REQUEST));
+ LOG.setRetryNonIndependent(retryNonIdempotent, serviceRole);
Review Comment:
IMO, this should be outside of this `if` statement. Otherwise, we would
assume it's set to default because the log entry was not shown.
##########
gateway-spi/src/main/java/org/apache/knox/gateway/SpiGatewayMessages.java:
##########
@@ -91,10 +91,10 @@ public interface SpiGatewayMessages {
text = "The dispatch to {0} was disallowed because it fails the
dispatch whitelist validation. See documentation for dispatch whitelisting." )
void dispatchDisallowed(String uri);
- @Message( level = MessageLevel.DEBUG, text = "HTTP client connection timeout
is set to {0} for {1}" )
+ @Message( level = MessageLevel.INFO, text = "HTTP client connection timeout
is set to {0} msec for {1}" )
void setHttpClientConnectionTimeout(int connectionTimeout, String
serviceRole);
- @Message( level = MessageLevel.DEBUG, text = "HTTP client socket timeout is
set to {0} for {1}" )
+ @Message( level = MessageLevel.INFO, text = "HTTP client socket timeout is
set to {0} msec for {1}" )
Review Comment:
It should either be `ms` or `milliseconds`.
##########
gateway-spi/src/main/java/org/apache/knox/gateway/SpiGatewayMessages.java:
##########
@@ -91,10 +91,10 @@ public interface SpiGatewayMessages {
text = "The dispatch to {0} was disallowed because it fails the
dispatch whitelist validation. See documentation for dispatch whitelisting." )
void dispatchDisallowed(String uri);
- @Message( level = MessageLevel.DEBUG, text = "HTTP client connection timeout
is set to {0} for {1}" )
+ @Message( level = MessageLevel.INFO, text = "HTTP client connection timeout
is set to {0} msec for {1}" )
void setHttpClientConnectionTimeout(int connectionTimeout, String
serviceRole);
- @Message( level = MessageLevel.DEBUG, text = "HTTP client socket timeout is
set to {0} for {1}" )
+ @Message( level = MessageLevel.INFO, text = "HTTP client socket timeout is
set to {0} msec for {1}" )
void setHttpClientSocketTimeout(int csocketTimeout, String serviceRole);
Review Comment:
nit: typo in `csocketTimeout`: either `clientSocketTimeout` or
`socketTimeout` (I prefer the 2nd one).
##########
gateway-spi/src/main/java/org/apache/knox/gateway/SpiGatewayMessages.java:
##########
@@ -91,10 +91,10 @@ public interface SpiGatewayMessages {
text = "The dispatch to {0} was disallowed because it fails the
dispatch whitelist validation. See documentation for dispatch whitelisting." )
void dispatchDisallowed(String uri);
- @Message( level = MessageLevel.DEBUG, text = "HTTP client connection timeout
is set to {0} for {1}" )
+ @Message( level = MessageLevel.INFO, text = "HTTP client connection timeout
is set to {0} msec for {1}" )
Review Comment:
It should either be `ms` or `milliseconds`
Issue Time Tracking
-------------------
Worklog Id: (was: 788232)
Time Spent: 50m (was: 40m)
> Log HTTP client config parameters such as socket timeouts with info level
> -------------------------------------------------------------------------
>
> Key: KNOX-2771
> URL: https://issues.apache.org/jira/browse/KNOX-2771
> Project: Apache Knox
> Issue Type: Improvement
> Reporter: Balazs Marton
> Priority: Minor
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Timeout parameters can be defined in two places, in gateway-site.xml and
> service.xml
>
> {code:java}
> gateway.httpclient.connectionTimeout -> 6000000
> gateway.httpclient.socketTimeout -> 6000000
> {code}
>
> {code:java}
> <dispatch classname="org.apache.knox.gateway.hive.HiveDispatch"
> ha-classname="org.apache.knox.gateway.hive.HiveHaDispatch">
> <param>
> <name>httpclient.connectionTimeout</name>
> <value>5m</value>
> </param>
> <param>
> <name>httpclient.socketTimeout</name>
> <value>5m</value>
> </param>
> </dispatch> {code}
> The latter takes priority over the former. There are multiple examples where
> the customer and/or the support tried to set these in gateway-site level but
> it didn't work.
> It would be good to see these parameters (plus other http related configs) in
> the log.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)