未解决问题_客户端在 RPC 调用时阻塞

测试一个扩展 Log4j 的 Appender 时,与服务器通信时程序就没反应了,不报错,不返回

具体在引发RPC 调用的地方造成进程阻塞:

fileSystem.exists(path)

fileSystem 是在 Appender 中创建的:

this.conf = new Configuration();
		try {
			fileSystem = FileSystem.get(conf);
		} catch (IOException e) {
			if (e instanceof InterruptedIOException) {
				Thread.currentThread().interrupt();
			}
			LogLog.error(
					"cannot get  the configured filesystem implementation.", e);
		}

在 Eclipse 中 Console View 里也结束不掉。最后直接把 Appender 丢到集群中,在集群中就没有这个问题。

看上去像是环境问题,但如果不用 Appender 直接向HDFS中写文件也不存在这个问题。所以还是和LOG4J有直接关系

由于问题没解决,先留下这个线程的完整信息:

Deadlock Detection:

No deadlocks found.

Thread 30697: (state = BLOCKED)
 - java.lang.Shutdown.exit(int) @bci=96, line=168 (Interpreted frame)
 - java.lang.Terminator$1.handle(sun.misc.Signal) @bci=8, line=35 (Interpreted frame)
 - sun.misc.Signal$1.run() @bci=8, line=195 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)


Thread 30696: (state = BLOCKED)
 - java.lang.Shutdown.exit(int) @bci=96, line=168 (Interpreted frame)
 - java.lang.Terminator$1.handle(sun.misc.Signal) @bci=8, line=35 (Interpreted frame)
 - sun.misc.Signal$1.run() @bci=8, line=195 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)


Thread 30695: (state = BLOCKED)
 - java.lang.Shutdown.exit(int) @bci=96, line=168 (Interpreted frame)
 - java.lang.Terminator$1.handle(sun.misc.Signal) @bci=8, line=35 (Interpreted frame)
 - sun.misc.Signal$1.run() @bci=8, line=195 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)


Thread 30694: (state = BLOCKED)
 - org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(java.lang.String) @bci=9, line=154 (Interpreted frame)
 - org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(java.lang.Class) @bci=5, line=132 (Interpreted frame)
 - org.apache.commons.logging.LogFactory.getLog(java.lang.Class) @bci=4, line=272 (Interpreted frame)
 - org.apache.hadoop.hdfs.LeaseRenewer.<clinit>() @bci=3, line=72 (Interpreted frame)
 - org.apache.hadoop.hdfs.DFSClient.getLeaseRenewer() @bci=9, line=575 (Interpreted frame)
 - org.apache.hadoop.hdfs.DFSClient.close() @bci=18, line=728 (Interpreted frame)
 - org.apache.hadoop.hdfs.DistributedFileSystem.close() @bci=8, line=561 (Interpreted frame)
 - org.apache.hadoop.fs.FileSystem$Cache.closeAll(boolean) @bci=114, line=2398 (Interpreted frame)
 - org.apache.hadoop.fs.FileSystem$Cache$ClientFinalizer.run() @bci=5, line=2414 (Interpreted frame)
 - org.apache.hadoop.util.ShutdownHookManager$1.run() @bci=42, line=54 (Interpreted frame)


Thread 30692: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - java.lang.Thread.join(long) @bci=38, line=1186 (Interpreted frame)
 - java.lang.Thread.join() @bci=2, line=1239 (Interpreted frame)
 - java.lang.ApplicationShutdownHooks.runHooks() @bci=87, line=79 (Interpreted frame)
 - java.lang.ApplicationShutdownHooks$1.run() @bci=0, line=24 (Interpreted frame)
 - java.lang.Shutdown.runHooks() @bci=23, line=79 (Interpreted frame)
 - java.lang.Shutdown.sequence() @bci=26, line=123 (Interpreted frame)
 - java.lang.Shutdown.exit(int) @bci=96, line=168 (Interpreted frame)
 - java.lang.Terminator$1.handle(sun.misc.Signal) @bci=8, line=35 (Interpreted frame)
 - sun.misc.Signal$1.run() @bci=8, line=195 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)


Thread 30691: (state = BLOCKED)
 - org.apache.log4j.Category.callAppenders(org.apache.log4j.spi.LoggingEvent) @bci=13, line=205 (Interpreted frame)
 - org.apache.log4j.Category.forcedLog(java.lang.String, org.apache.log4j.Priority, java.lang.Object, java.lang.Throwable) @bci=14, line=391 (Interpreted frame)
 - org.apache.log4j.Category.log(java.lang.String, org.apache.log4j.Priority, java.lang.Object, java.lang.Throwable) @bci=34, line=856 (Interpreted frame)
 - org.slf4j.impl.Log4jLoggerAdapter.log(org.slf4j.Marker, java.lang.String, int, java.lang.String, java.lang.Object[], java.lang.Throwable) @bci=148, line=602 (Interpreted frame)
 - org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(java.lang.Object) @bci=16, line=133 (Interpreted frame)
 - org.apache.hadoop.ipc.Client$Connection$3.run() @bci=82, line=891 (Interpreted frame)
 - java.util.concurrent.Executors$RunnableAdapter.call() @bci=4, line=441 (Interpreted frame)
 - java.util.concurrent.FutureTask$Sync.innerRun() @bci=30, line=303 (Interpreted frame)
 - java.util.concurrent.FutureTask.run() @bci=4, line=138 (Interpreted frame)
 - java.util.concurrent.ThreadPoolExecutor$Worker.runTask(java.lang.Runnable) @bci=59, line=886 (Interpreted frame)
 - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=28, line=908 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=662 (Interpreted frame)


Thread 30690: (state = BLOCKED)
 - org.apache.log4j.Category.callAppenders(org.apache.log4j.spi.LoggingEvent) @bci=13, line=205 (Interpreted frame)
 - org.apache.log4j.Category.forcedLog(java.lang.String, org.apache.log4j.Priority, java.lang.Object, java.lang.Throwable) @bci=14, line=391 (Interpreted frame)
 - org.apache.log4j.Category.log(java.lang.String, org.apache.log4j.Priority, java.lang.Object, java.lang.Throwable) @bci=34, line=856 (Interpreted frame)
 - org.slf4j.impl.Log4jLoggerAdapter.log(org.slf4j.Marker, java.lang.String, int, java.lang.String, java.lang.Object[], java.lang.Throwable) @bci=148, line=602 (Interpreted frame)
 - org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(java.lang.Object) @bci=16, line=133 (Interpreted frame)
 - org.apache.hadoop.ipc.Client$Connection.run() @bci=49, line=831 (Interpreted frame)


Thread 30684: (state = BLOCKED)


Thread 30682: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=118 (Interpreted frame)
 - java.lang.ref.ReferenceQueue.remove() @bci=2, line=134 (Interpreted frame)
 - java.lang.ref.Finalizer$FinalizerThread.run() @bci=3, line=159 (Interpreted frame)


Thread 30681: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - java.lang.Object.wait() @bci=2, line=485 (Interpreted frame)
 - java.lang.ref.Reference$ReferenceHandler.run() @bci=46, line=116 (Interpreted frame)


Thread 30675: (state = BLOCKED)
 - sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
 - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=156 (Interpreted frame)
 - java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt() @bci=1, line=811 (Interpreted frame)
 - java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(int) @bci=55, line=969 (Interpreted frame)
 - java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(int) @bci=24, line=1281 (Interpreted frame)
 - java.util.concurrent.FutureTask$Sync.innerGet() @bci=2, line=218 (Interpreted frame)
 - java.util.concurrent.FutureTask.get() @bci=4, line=83 (Interpreted frame)
 - org.apache.hadoop.ipc.Client$Connection.sendParam(org.apache.hadoop.ipc.Client$Call) @bci=79, line=913 (Interpreted frame)
 - org.apache.hadoop.ipc.Client.call(org.apache.hadoop.ipc.RPC$RpcKind, org.apache.hadoop.io.Writable, org.apache.hadoop.ipc.Client$ConnectionId) @bci=25, line=1198 (Interpreted frame)
 - org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) @bci=134, line=202 (Interpreted frame)
 - $Proxy9.getFileInfo(com.google.protobuf.RpcController, org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$GetFileInfoRequestProto) @bci=20 (Interpreted frame)
 - sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) @bci=0 (Interpreted frame)
 - sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) @bci=87, line=39 (Interpreted frame)
 - sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) @bci=6, line=25 (Interpreted frame)
 - java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) @bci=161, line=597 (Interpreted frame)
 - org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(java.lang.reflect.Method, java.lang.Object[]) @bci=18, line=164 (Interpreted frame)
 - org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) @bci=66, line=83 (Interpreted frame)
 - $Proxy9.getFileInfo(com.google.protobuf.RpcController, org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$GetFileInfoRequestProto) @bci=20 (Interpreted frame)
 - org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(java.lang.String) @bci=17, line=629 (Interpreted frame)
 - org.apache.hadoop.hdfs.DFSClient.getFileInfo(java.lang.String) @bci=9, line=1545 (Interpreted frame)
 - org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(org.apache.hadoop.fs.Path) @bci=17, line=820 (Interpreted frame)
 - org.apache.hadoop.fs.FileSystem.exists(org.apache.hadoop.fs.Path) @bci=2, line=1378 (Interpreted frame)
 - com.embracesource.edh.log4j.append.HdfsDailyRollingFileAppender.setFile(java.lang.String, boolean, boolean, int) @bci=63, line=407 (Interpreted frame)
 - org.apache.log4j.FileAppender.activateOptions() @bci=24, line=165 (Interpreted frame)
 - com.embracesource.edh.log4j.append.HdfsDailyRollingFileAppender.activateOptions() @bci=1, line=235 (Interpreted frame)
 - org.apache.log4j.config.PropertySetter.activate() @bci=17, line=307 (Interpreted frame)
 - org.apache.log4j.config.PropertySetter.setProperties(java.util.Properties, java.lang.String) @bci=438, line=172 (Interpreted frame)
 - org.apache.log4j.config.PropertySetter.setProperties(java.lang.Object, java.util.Properties, java.lang.String) @bci=10, line=104 (Interpreted frame)
 - org.apache.log4j.PropertyConfigurator.parseAppender(java.util.Properties, java.lang.String) @bci=694, line=809 (Interpreted frame)
 - org.apache.log4j.PropertyConfigurator.parseCategory(java.util.Properties, org.apache.log4j.Logger, java.lang.String, java.lang.String, java.lang.String) @bci=280, line=735 (Interpreted frame)
 - org.apache.log4j.PropertyConfigurator.configureRootCategory(java.util.Properties, org.apache.log4j.spi.LoggerRepository) @bci=63, line=615 (Interpreted frame)
 - org.apache.log4j.PropertyConfigurator.doConfigure(java.util.Properties, org.apache.log4j.spi.LoggerRepository) @bci=134, line=502 (Interpreted frame)
 - org.apache.log4j.PropertyConfigurator.doConfigure(java.net.URL, org.apache.log4j.spi.LoggerRepository) @bci=246, line=547 (Interpreted frame)
 - org.apache.log4j.helpers.OptionConverter.selectAndConfigure(java.net.URL, java.lang.String, org.apache.log4j.spi.LoggerRepository) @bci=129, line=483 (Interpreted frame)
 - org.apache.log4j.LogManager.<clinit>() @bci=156, line=127 (Interpreted frame)
 - org.slf4j.impl.Log4jLoggerFactory.getLogger(java.lang.String) @bci=42, line=73 (Interpreted frame)
 - org.slf4j.LoggerFactory.getLogger(java.lang.String) @bci=6, line=253 (Interpreted frame)
 - org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(java.lang.String) @bci=28, line=156 (Interpreted frame)
 - org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(java.lang.Class) @bci=5, line=132 (Interpreted frame)
 - org.apache.commons.logging.LogFactory.getLog(java.lang.Class) @bci=4, line=272 (Interpreted frame)
 - com.embracesource.edh.log4j.append.TestLOG.<init>() @bci=7, line=8 (Interpreted frame)
 - com.embracesource.edh.log4j.append.TestLOG.main(java.lang.String[]) @bci=4, line=11 (Interpreted frame)





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值