Skip to content

Change log level of AgentHandler#processRequest() #10869

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

Open
wants to merge 1 commit into
base: 4.19
Choose a base branch
from

Conversation

vits-hugs
Copy link
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
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.

Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: 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 11 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.

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.

2 participants