Comments (4)
What version of the com.rabbitmq:amqp-client dependency are you running? Version 4.0.0 introduced a change to ForgivingExceptionHandler.java to log the error. In previous versions, it did nothing with the error. As a work around, can you downgrade the amqp-client version?
from logback-gelf.
I'm running on amqp-client:5.12.0. As a temporary workaround, I replaced the GelfAMQPSender class with the Channel#waitForConfirms(long timeout)
call instead of the Channel#waitForConfirms()
one.
...
BasicProperties properties = propertiesBuilder.build();
channel.basicPublish(
exchangeName,
routingKey,
properties,
toAMQPBuffer(message.toJson()).array());
channel.waitForConfirms(waitForConfirmsTimeout); // trying to prevent deadlock when the AMQP Connection thread logs the MissedHeartbeatException
return true;
...
If it's correct solution, I can make PR with the waitForConfirmsTimeout
config parameter for the GelfAppender.
from logback-gelf.
I'm surprised your workaround mitigates the issue. It's a fundamental design flaw. The logger invokes amqp-client to send messages. The amqp-client invokes the logger to log errors. This circular dependency leads to the deadlock.
Another possible solution is configure logback to not send log events from amqp-client to the GelfAppender.
from logback-gelf.
I suppose that deadlock can occur when the app tries to log any message via amqp connection with an unresponsive peer. The waitForConfirms()
or the waitForConfirms(0)
methods call Object#wait()
and thread may wait forever (except spurious wakeup). If log events from amqp-client aren't send to the GelfAppender and amqp connection became disrupted, I'm not sure that any next GelfAppender sending will not lead to the same issue.
The amqp-client invokes the logger to log MissedHeartbeatException exceptions from another tread.
If the waitForConfirmsTimeout
expires, a TimeoutException will be thrown. That will recreate the channel, connection and increments tries. Finally, the connection will be recovered or we will get the ErrorStatus.
from logback-gelf.
Related Issues (12)
- Update Logback version HOT 2
- Logback configuration error detected with logback 1.1.7 HOT 5
- Upgrade to logback 1.1.7 breaks this library when additionalFields are used - tests missing? HOT 1
- Update AMQP Client version? HOT 1
- Add project to Graylog Marketplace
- How to configure a gelfappender Programmatically? HOT 1
- Application fails to start when the appender is not able to communicate with gray log instance HOT 2
- GelfSender is not closing streams on exception
- Provide the custom facility to log messages HOT 2
- How to configure TCP over SSL protocol HOT 3
- GelfAMQPSender channel confirmation issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logback-gelf.