Appdynamics / Appdynamics/qos-ch-logback

Class RollingFileAppender may have exceptions under thread concurrency?

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

hey,

We have an exception. Here is the exception stack information
```
java.util.ConcurrentModificationException: null
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1493)
at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1526)
at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1524)
at ch.qos.logback.core.rolling.RollingFileAppender.innerCheckForFileNamePatternCollisionInPreviousRFA(RollingFileAppender.java:135)
at ch.qos.logback.core.rolling.RollingFileAppender.checkForCollisionsInPreviousRollingFileAppenders(RollingFileAppender.java:121)
at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:62)
```

ch.qos.logback.core.rolling.RollingFileAppender#innerCheckForFileNamePatternCollisionInPreviousRFA

![image](https://user-images.githubusercontent.com/65394715/142588989-abb12ff9-f4fe-402c-bd0e-89e3b0044d05.png)
For the two pieces of code in the red box in the screenshot,
`Thread1` traversal `map`, and `thread2 `modifies `map `at the same time,whether an exception will be thrown `java.util.ConcurrentModificationException: null`,Is this a bug?

Contributor guide

Open the contributing guide

Research direction

Start at ch.qos.logback.core.rolling.RollingFileAppender#innerCheckForFileNamePatternCollisionInPreviousRFA and trace the map used by the collision checks in the stack trace. Reproduce concurrent appender startup if possible and determine whether iteration can overlap modification; done means confirming the bug with a focused regression test or recording why the reported exception cannot occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.