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

Duplicate logs observer in cruise control #2118

Open
saeedya opened this issue Feb 2, 2024 · 5 comments · May be fixed by #2135
Open

Duplicate logs observer in cruise control #2118

saeedya opened this issue Feb 2, 2024 · 5 comments · May be fixed by #2135
Labels
good first issue A good fit as a first issue in the project. productivity A meta-change in the project.

Comments

@saeedya
Copy link

saeedya commented Feb 2, 2024

On below link
https://github.com/linkedin/cruise-control/blob/137b1fe0552c4aa49ebc900b75786eeee033bbe7/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/servlet/handler/async/AbstractAsyncRequest.java
In the method "CruiseControlResponse" , i can see some duplicate logs. This my sample log file:

6231 {"version": "1.2.0", "timestamp": "2024-02-02T14:49:34.908+00:00", "severity": "info", "message": "### Processing async request CruiseControlStateRequest.", "metadata": {"container_name": "cruise-control", "pod_name": "extra_data": {"file": "### AbstractAsyncRequest.java", "line": "49", }}
6232 {"version": "1.2.0", "timestamp": "2024-02-02T14:49:34.908+00:00", "severity": "info", "message": "### Processing async request CruiseControlStateRequest.", "metadata": {"container_name": "cruise-control", "pod_name": "extra_data": {"file": "### AbstractAsyncRequest.java", "line": "49", }}
6299 {"version": "1.2.0", "timestamp": "2024-02-02T14:49:35.066+00:00", "severity": "info", "message": "### Computation is completed for async request: /state.", "metadata": {"container_name": "cruise-control", "pod_name": "extra_data": {"file": "### AbstractAsyncRequest.java", "line": "57", }}
6300 {"version": "1.2.0", "timestamp": "2024-02-02T14:49:35.066+00:00", "severity": "info", "message": ### "Computation is completed for async request: /state.", "metadata": {"container_name": "cruise-control", "pod_name": "extra_data": {"file": ### "AbstractAsyncRequest.java", "line": "57", }}
6301 {"version": "1.2.0", "timestamp": "2024-02-02T14:49:35.094+00:00", "severity": "info", ### "message": "127.0.0.1 - user [02/Feb/2024:14:49:34 +0000] "GET /kafkacruiseco ntrol/state HTTP/1.1" 200 1095", "metadata": {"container_name": "cruise-control", "pod_name": "extra_data": ### {"file": "Slf4jRequestLogWriter.java ", "line": "62", }}
6302 {"version": "1.2.0", "timestamp": "2024-02-02T14:49:35.094+00:00", "severity": "info", ### "message": "127.0.0.1 - user [02/Feb/2024:14:49:34 +0000] "GET /kafkacruiseco ntrol/state HTTP/1.1" 200 1095", "metadata": {"container_name": "cruise-control", "pod_name": "extra_data": ### {"file": "Slf4jRequestLogWriter.java ", "line": "62", }}

Regards,
Saeed

@saeedya
Copy link
Author

saeedya commented Feb 8, 2024

Hi @scholzj
Can you please help me with this?
Kind Regards,
Saeed

@scholzj
Copy link

scholzj commented Feb 8, 2024

I have no idea I'm afraid - I do not know much about Cruise Control.

@CCisGG CCisGG added good first issue A good fit as a first issue in the project. productivity A meta-change in the project. labels Feb 21, 2024
@marcelloromani
Copy link

Why do you think there's duplication? What would you change in the log message?

@vasilisa-za
Copy link

Root cause of the issue seems to be log4j configuration here. kafkaCruiseControlFile appender added for both root and com.linkedin.kafka.cruisecontrol loggers, resulting in messaged being appended twice.

Verified by running by simple test locally:

  1. Same appender added for two intersected loggers results in duplicated message:
    image

  2. Commenting out appender for one of the loggers removes message duplication:
    image

@vasilisa-za
Copy link

Looks like original intent of logging everything into console and additionally com.linkedin.kafka.cruisecontrol into dedicated file appender was broken in this PR.

Could you please assign this issue to me, so I could raise a PR to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good fit as a first issue in the project. productivity A meta-change in the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants