flume-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yashon (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLUME-3035) Log loop print “Using default maxIOWorkers”,Cause stack overflow
Date Sat, 17 Dec 2016 03:34:58 GMT
Yashon created FLUME-3035:
-----------------------------

             Summary: Log loop print “Using default maxIOWorkers”,Cause stack overflow
                 Key: FLUME-3035
                 URL: https://issues.apache.org/jira/browse/FLUME-3035
             Project: Flume
          Issue Type: Bug
          Components: Client SDK
    Affects Versions: v1.7.0
         Environment: - jdk version:jdk1.8
- software platform:win10/CentOs 7
            Reporter: Yashon


Configuration:
*pom.xml*
{code:xml}
        <dependency>
            <groupId>org.apache.flume.flume-ng-clients</groupId>
            <artifactId>flume-ng-log4jappender</artifactId>
            <version>1.7.0</version>
        </dependency>
{code}

*log4j.properties*
{code}
log4j.appender.flume = org.apache.flume.clients.log4jappender.LoadBalancingLog4jAppender
log4j.appender.flume.Hosts = fooflumesource.com:25430 barflumesource.com:25430
log4j.appender.flume.Selector = ROUND_ROBIN
log4j.appender.flume.MaxBackoff = 60000
log4j.logger.org.apache.flume.clients.log4jappender = DEBUG,flume
{code}

Problem description:
Log loop print “2016-12-17 10:48:53,629 WARN NettyAvroRpcClient:634 *Using default maxIOWorkers*”,Cause
stack overflow;
{code}
Exception in thread "main" java.lang.StackOverflowError
	at java.util.Calendar.setTime(Calendar.java:1770)
	at java.text.SimpleDateFormat.format(SimpleDateFormat.java:943)
	at java.text.SimpleDateFormat.format(SimpleDateFormat.java:936)
	at java.text.DateFormat.format(DateFormat.java:345)
	at org.apache.log4j.helpers.PatternParser$DatePatternConverter.convert(PatternParser.java:443)
	at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:65)
	at org.apache.log4j.PatternLayout.format(PatternLayout.java:506)
	at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:310)
	at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)
	at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
	at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
	at org.apache.log4j.Category.callAppenders(Category.java:206)
	at org.apache.log4j.Category.forcedLog(Category.java:391)
	at org.apache.log4j.Category.log(Category.java:856)
	at org.slf4j.impl.Log4jLoggerAdapter.warn(Log4jLoggerAdapter.java:400)
	at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:634)
	at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:90)
	at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:214)
	at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:197)
	at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:71)
	at org.apache.flume.clients.log4jappender.Log4jAppender.append(Log4jAppender.java:162)
	at org.apache.flume.clients.log4jappender.LoadBalancingLog4jAppender.append(LoadBalancingLog4jAppender.java:111)
	at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
	at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
	at org.apache.log4j.Category.callAppenders(Category.java:206)
	at org.apache.log4j.Category.forcedLog(Category.java:391)
	at org.apache.log4j.Category.log(Category.java:856)
	at org.slf4j.impl.Log4jLoggerAdapter.warn(Log4jLoggerAdapter.java:400)
	at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:634)
	at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:90)
	at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:214)
	at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:197)
	at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:71)
	at org.apache.flume.clients.log4jappender.Log4jAppender.append(Log4jAppender.java:162)
	at org.apache.flume.clients.log4jappender.LoadBalancingLog4jAppender.append(LoadBalancingLog4jAppender.java:111)
	at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
	at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
	at org.apache.log4j.Category.callAppenders(Category.java:206)
	at org.apache.log4j.Category.forcedLog(Category.java:391)
	at org.apache.log4j.Category.log(Category.java:856)
	at org.slf4j.impl.Log4jLoggerAdapter.warn(Log4jLoggerAdapter.java:400)
{code}

Problem analysis:
{code:title=NettyAvroRpcClient.java|borderStyle=solid}
// Some comments here
public synchronized void configure(Properties properties)
      throws FlumeException {

//=====Ignore the above code=======
    String maxIoWorkersStr = properties.getProperty(RpcClientConfigurationConstants.MAX_IO_WORKERS);
    if (!StringUtils.isEmpty(maxIoWorkersStr)) {
      try {
        maxIoWorkers = Integer.parseInt(maxIoWorkersStr);
      } catch (NumberFormatException ex) {
        logger.warn("Invalid maxIOWorkers:" + maxIoWorkersStr + " Using " +
            "default maxIOWorkers.");
        maxIoWorkers = -1;
      }
    }
  // When maxIoWorkersStr is null,maxIoWorkers less than 1,then print log into dead loop;
    if (maxIoWorkers < 1) {
      logger.warn("Using default maxIOWorkers");
      maxIoWorkers = -1;
    }

    this.connect();
}
{code}

Temporary solution:
{code:title=LoadBalancingLog4jAppender.java|borderStyle=solid}
private Properties getProperties(String hosts, String selector,
			String maxBackoff, long timeout) throws FlumeException {
//=====Ignore the above code=======
props.setProperty(RpcClientConfigurationConstants.MAX_IO_WORKERS,(Runtime.getRuntime()
                .availableProcessors() * 2)+"");
		return props;
}
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message