Skip to content

Change log level of AgentHandler#processRequest()#10869

Merged
weizhouapache merged 1 commit intoapache:4.19from
vits-hugs:agent#processRequest-change-log-level
Sep 10, 2025
Merged

Change log level of AgentHandler#processRequest()#10869
weizhouapache merged 1 commit intoapache:4.19from
vits-hugs:agent#processRequest-change-log-level

Conversation

@vits-hugs
Copy link
Copy Markdown
Contributor

Change log level

Description

In the method AgentHandler#processRequest(), the timeout exception of database requests are logged with level warning, this PR corrects the log level to error.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Running the project, and then stopping the database service, to trigger the exception shown below:

2025-04-25 16:20:39,356 ERROR [c.c.a.m.AgentManagerImpl] (AgentManager-Handler-1:null) (logid:) Caught: 
com.cloud.utils.exception.CloudRuntimeException: DB Exception on: null
	at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:864)
	at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:819)
	at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:1490)
	at com.cloud.vm.dao.ConsoleProxyDaoImpl.update(ConsoleProxyDaoImpl.java:138)
	at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at com.cloud.utils.db.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:34)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
	at com.sun.proxy.$Proxy191.update(Unknown Source)
	at com.cloud.consoleproxy.ConsoleProxyManagerImpl.updateConsoleProxyStatus(ConsoleProxyManagerImpl.java:1655)
	at com.cloud.consoleproxy.ConsoleProxyManagerImpl$VmBasedAgentHook.onLoadReport(ConsoleProxyManagerImpl.java:282)
	at com.cloud.consoleproxy.ConsoleProxyListener.processControlCommand(ConsoleProxyListener.java:56)

This other exception was triggered during remote debug, setting the _key variable to null on the file utils/src/main/java/com/cloud/utils/nio/Link.java line 316.

2025-04-25 16:39:08,580 ERROR [c.c.a.m.AgentManagerImpl] (AgentManager-Handler-8:null) (logid:) Unable to send response because connection is closed: Seq 2-395:  { Ans: , MgmtId: 51351695036381, via: 2, Ver: v1, Flags: 100010, [{"com.cloud.agent.api.Answer":{"result":"false","details":"DB Exception on: null","wait":"0","bypassHostMaintenance":"false"}}] }
2025-04-25 16:38:47,782 ERROR [c.c.a.m.AgentManagerImpl] (AgentManager-Handler-5:null) (logid:) Caught: 
com.cloud.utils.exception.CloudRuntimeException: DB Exception on: null
	at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:864)
	at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:819)
	at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:1490)
	at com.cloud.vm.dao.ConsoleProxyDaoImpl.update(ConsoleProxyDaoImpl.java:138)
	at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at com.cloud.utils.db.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:34)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
	at com.sun.proxy.$Proxy191.update(Unknown Source)
	at com.cloud.consoleproxy.ConsoleProxyManagerImpl.updateConsoleProxyStatus(ConsoleProxyManagerImpl.java:1655)

How did you try to break this feature and the system with this change?

@DaanHoogland
Copy link
Copy Markdown
Contributor

@vits-hugs , your change looks good, but could you give some explanation as to why these should be errors instead of warnings, in your opinion?

To explain my doubts; processRequest(Link,Request) is rather large and all kinds of thinks may happen that cause exceptions. Some of those may not be hindering operations, others may. Is there a paerticular exception (that we should then catch seperately) that is a concern?

For the second one; a closed channel should be reopened automatically within a few seconds.

@codecov
Copy link
Copy Markdown

codecov bot commented May 15, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.17%. Comparing base (f0838cd) to head (cf530f0).
⚠️ Report is 75 commits behind head on 4.19.

Files with missing lines Patch % Lines
...java/com/cloud/agent/manager/AgentManagerImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #10869      +/-   ##
============================================
- Coverage     15.17%   15.17%   -0.01%     
- Complexity    11339    11346       +7     
============================================
  Files          5414     5415       +1     
  Lines        475185   475571     +386     
  Branches      57991    58036      +45     
============================================
+ Hits          72105    72154      +49     
- Misses       395018   395349     +331     
- Partials       8062     8068       +6     
Flag Coverage Δ
uitests 4.28% <ø> (-0.01%) ⬇️
unittests 15.89% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13611

@weizhouapache weizhouapache modified the milestones: 4.19.4, 4.20.2 Sep 2, 2025
Copy link
Copy Markdown
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Copy link
Copy Markdown
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@weizhouapache
Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14930

@weizhouapache weizhouapache merged commit 2e113e5 into apache:4.19 Sep 10, 2025
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants