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

-ERROR in com.aliyun.openservices.log.logback.LoghubAppender[INFO_PLUS] - Failed to send log, #31

Open
born198x opened this issue Jul 24, 2020 · 3 comments

Comments

@born198x
Copy link

按你们标准配置来的,出现了日志推送失败的报错,详细报错如下:
我用的 springboot 2.1.5版本整合的,logback日志
-ERROR in com.aliyun.openservices.log.logback.LoghubAppender[INFO_PLUS] - Failed to send log, project=app-log-center, logStore=xolo-job-executor, topic=test, source=, logItem=[com.aliyun.openservices.log.common.LogItem@239099d4] java.lang.InterruptedException
at java.lang.InterruptedException
at at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326)
at at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:582)
at at com.aliyun.openservices.aliyun.log.producer.internals.LogAccumulator.doAppend(LogAccumulator.java:113)
at at com.aliyun.openservices.aliyun.log.producer.internals.LogAccumulator.append(LogAccumulator.java:84)
at at com.aliyun.openservices.aliyun.log.producer.LogProducer.send(LogProducer.java:385)
at at com.aliyun.openservices.aliyun.log.producer.LogProducer.send(LogProducer.java:286)
at at com.aliyun.openservices.log.logback.LoghubAppender.appendEvent(LoghubAppender.java:171)
at at com.aliyun.openservices.log.logback.LoghubAppender.append(LoghubAppender.java:117)
at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:84)
at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51)
at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:270)
at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:257)
at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:421)
at at ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:398)
at at ch.qos.logback.classic.Logger.info(Logger.java:583)
at at com.xxl.job.core.thread.JobThread.run(JobThread.java:216)

@zhongyiio
Copy link

遇到同样的问题,现在解决了吗?

Java11
Spring Boot 2.3.0.RELEASE

14:48:33,012 |-ERROR in com.aliyun.openservices.log.logback.LoghubAppender[loghubAppender2] - Failed to send log, project=XXX, logStore=XXX, topic=, source=, logItem=[com.aliyun.openservices.log.common.LogItem@1f50dbbb] java.lang.InterruptedException
	at java.lang.InterruptedException
	at 	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(Unknown Source)
	at 	at java.base/java.util.concurrent.Semaphore.tryAcquire(Unknown Source)
	at 	at com.aliyun.openservices.aliyun.log.producer.internals.LogAccumulator.doAppend(LogAccumulator.java:113)
	at 	at com.aliyun.openservices.aliyun.log.producer.internals.LogAccumulator.append(LogAccumulator.java:84)
	at 	at com.aliyun.openservices.aliyun.log.producer.LogProducer.send(LogProducer.java:385)
	at 	at com.aliyun.openservices.aliyun.log.producer.LogProducer.send(LogProducer.java:286)
	at 	at com.aliyun.openservices.log.logback.LoghubAppender.appendEvent(LoghubAppender.java:171)
	at 	at com.aliyun.openservices.log.logback.LoghubAppender.append(LoghubAppender.java:117)
	at 	at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:84)
	at 	at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51)
	at 	at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:270)
	at 	at ch.qos.logback.classic.Logger.callAppenders(Logger.java:257)
	at 	at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:421)
	at 	at ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:398)
	at 	at ch.qos.logback.classic.Logger.info(Logger.java:583)
	at 	at com.xxl.job.core.thread.JobThread.run(JobThread.java:247)

@zhongyiio
Copy link

我的问题只发生在 xxl-job 执行任务的 Thread 里。因为 xxl-job 的进程管理大量使用了 Thread.interrupte(),而 interrupte 之后 Thread 并不会立刻销毁,而且每个 Job 结束都会有 log.info("Job thread close xxx"),这样 interrupte 之后可能会继续执行 log.info,会触发 aliyun-log-logback-appender 发送日志到日志服务,但是 aliyun-log-logback-appender 里使用了 semaphore,在尝试获取 semaphore 时会检查 Thread 的状态。

@cy503328434
Copy link

Thread
那要怎么解决呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants