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

Investigate improving synchronization mechanism between BaseTraceService and MessageLogHandler #1439

Closed
Channyboy opened this issue Jan 4, 2018 · 0 comments

Comments

@Channyboy
Copy link
Contributor

Investigate improving synchronization mechanism between BaseTraceService/JsonTraceService and MessageLogHandler.

Currently, the synchronization mechanism is to lock on an shared object between the BaseTraceService/JsonTraceService and MessageLogHandler.

A synchronization mechanism is needed to avoid a deadlock that can occur between the two classes. This deadlock occurs when trace is set to *=all and occurs quickly during server start up.

The deadlock occurs due to the synchronized methods of FileLogHolder and a (previously) synchronized method synchronousWrite in MessageLogHandler which makes calls to FileLogHolder. Under a high trace volume, the synchronousWrite frequently locks (lock 1) on the calling thread. When a server configuration update is called, certain update logic is made to FileLogHolder through a separate thread (lock 2). This lock prevents any other threads that are trying to write via MessageLogHandler. Further into the update stack, a tracing event is emitted and is stuck waiting for lock 1 to unlock.

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

No branches or pull requests

4 participants