Skip to content

undo removal of accessLogger and deal with some warnings - #10567

Merged
harikrishna-patnala merged 3 commits into
apache:4.20from
shapeblue:ghi10565-apiLogger
Apr 14, 2025
Merged

undo removal of accessLogger and deal with some warnings#10567
harikrishna-patnala merged 3 commits into
apache:4.20from
shapeblue:ghi10565-apiLogger

Conversation

@DaanHoogland

@DaanHooglandDaanHoogland commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

Description

This PR

Fixes: #10565

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?

started an env and monitorred /var/log/cloudstack/management/apilog.log

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

@DaanHooglandDaanHoogland changed the title undo removval of accessLogger and deal with some warningsundo removal of accessLogger and deal with some warningsMar 13, 2025
@DaanHooglandDaanHoogland linked an issue Mar 13, 2025 that may be closed by this pull request
@codecov

codecovBot commented Mar 13, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 29.68750% with 45 lines in your changes missing coverage. Please review.

Project coverage is 16.01%. Comparing base (f8adedc) to head (b031d99).
Report is 31 commits behind head on 4.20.

Files with missing linesPatch %Lines
server/src/main/java/com/cloud/api/ApiServer.java27.41%45 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## 4.20 #10567 +/- ##
=========================================
Coverage 16.00% 16.01% - Complexity 13104 13113 +9 
=========================================
Files 5651 5651 Lines 495843 495853 +10 Branches 60045 60047 +2 =========================================
+ Hits 79363 79409 +46 + Misses 407624 407581 -43 - Partials 8856 8863 +7 
FlagCoverage Δ
uitests4.00% <ø> (-0.01%)⬇️
unittests16.85% <29.68%> (+<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.

@GutoVeroneziGutoVeronezi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CLGTM

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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 12788

@Pearl1594

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@gp-santosgp-santos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd probably call the logger ACCESS_LOGGER (or API_LOGGER) since it's a constant, but it's not really an issue. LGTM

Edit: Actually, nevermind since it's a reference.

@Pearl1594

Copy link
Copy Markdown
Contributor

Thanks for reviewing @gpordeus!

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-12728)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 60369 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10567-t12728-kvm-ol8.zip
Smoke tests completed. 137 look OK, 4 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
ContextSuite context=TestIpv4Routing>:setupError0.00test_ipv4_routing.py
test_04_list_domains_level_filterFailure0.05test_list_domains.py
test_05_list_domains_no_filterFailure0.04test_list_domains.py
ContextSuite context=TestSharedNetworkWithConfigDrive>:setupError1520.66test_network.py
test_01_sys_vm_startFailure0.13test_secondary_storage.py

Comment threadserver/src/main/java/com/cloud/api/ApiServer.java Outdated
Comment threadserver/src/main/java/com/cloud/api/ApiServer.java Outdated
@DaanHoogland
DaanHoogland marked this pull request as ready for review March 19, 2025 16:31
@DaanHooglandDaanHoogland added this to the 4.20.1 milestone Mar 19, 2025
@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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 12831

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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 12850

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-12830)

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

tested and does not work to satisfaction yet (empty /var/log/cloudstack/management/apilog.log)

@DaanHoogland
DaanHoogland marked this pull request as draft March 27, 2025 09:37
@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

tested and does not work to satisfaction yet (empty /var/log/cloudstack/management/apilog.log)

cc @Pearl1594@JoaoJandre maybe a fluke but no cigar so far

@gp-santos

gp-santos commented Mar 28, 2025

Copy link
Copy Markdown
Collaborator

@DaanHoogland, I compared with the log4j2 PR and found the logger in ApiServlet is also missing.

As for the handle() method in ApiServer, its comment says it is used in requests from the integration port, but I haven't tested it.

(added the prints since opening the PR is a pain)

prints from #7131

image
image

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@DaanHoogland, I compared with the log4j2 PR and found the logger in ApiServlet is also missing.

As for the handle() method in ApiServer, its comment says it is used in requests from the integration port, but I haven't tested it.

(added the prints since opening the PR is a pain)
prints from #7131

thanks for the heads-up @gpordeus , will re-add that as well.

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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 12918

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-12853)

@DaanHoogland
DaanHoogland marked this pull request as ready for review March 29, 2025 18:27

@yadvryadvr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs QA, otherwise LGTM

@yadvr

yadvr commented Apr 7, 2025

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud 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 12968

@Pearl1594

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-12896)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 57129 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10567-t12896-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File

@harikrishna-patnalaharikrishna-patnala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tested and also code LGTM

[root@pr10567-t12975-kvm-ol8-mgmt1 management]# ls a*
access.log apilog.log
[root@pr10567-t12975-kvm-ol8-mgmt1 management]# tail -n 5 access.log 172.30.205.2 - - [14/Apr/2025:08:09:24 +0000] "GET /client/api/?command=listClusters&response=json&sessionkey=ONmBjAW4pzwCyVmLym1dWOIoD1Q HTTP/1.1" 200 339 "http://x.x.x.x:8080/client/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0" 60
172.30.205.2 - - [14/Apr/2025:08:09:25 +0000] "GET /client/api/?command=listStoragePools&response=json&sessionkey=ONmBjAW4pzwCyVmLym1dWOIoD1Q HTTP/1.1" 200 528 "http://x.x.x.x:8080/client/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0" 19
172.30.205.2 - - [14/Apr/2025:08:09:25 +0000] "GET /client/api/?listall=true&projectid=-1&command=listRouters&response=json&sessionkey=ONmBjAW4pzwCyVmLym1dWOIoD1Q HTTP/1.1" 200 26 "http://x.x.x.x:8080/client/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0" 15
172.30.205.2 - - [14/Apr/2025:08:09:25 +0000] "GET /client/api/?command=listSystemVms&response=json&sessionkey=ONmBjAW4pzwCyVmLym1dWOIoD1Q HTTP/1.1" 200 783 "http://x.x.x.x:8080/client/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0" 76
172.30.205.2 - - [14/Apr/2025:08:09:25 +0000] "GET /client/api/?listall=true&projectid=-1&details=min&page=1&pagesize=1&command=listVirtualMachines&response=json&sessionkey=ONmBjAW4pzwCyVmLym1dWOIoD1Q HTTP/1.1" 200 54 "http://x.x.x.x:8080/client/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0" 17
[root@pr10567-t12975-kvm-ol8-mgmt1 management]# tail -n 5 apilog.log 2025-04-14 08:09:25,202 INFO [a.c.c.a.ApiServlet] (qtp1390913202-20:[ctx-a7447dba, ctx-f96449d7]) (logid:86631311) (userId=2 accountId=2 sessionId=node01l98g1lhhmtqb1qmj5j6e1nb7v2) 172.30.205.2 -- GET listall=true&projectid=-1&details=min&page=1&pagesize=1&command=listVirtualMachines&response=json&sessionkey=ONmBjAW4pzwCyVmLym1dWOIoD1Q 200 {"listvirtualmachinesresponse":{}}
2025-04-14 08:09:29,467 INFO [a.c.c.a.ApiServlet] (qtp1390913202-23:[ctx-0d563675, ctx-864386e3]) (logid:82b480d5) (userId=2 accountId=2 sessionId=node01l98g1lhhmtqb1qmj5j6e1nb7v2) 172.30.205.2 -- GET command=readyForShutdown&response=json&sessionkey=ONmBjAW4pzwCyVmLym1dWOIoD1Q 200 {"readyforshutdownresponse":{"readyforshutdown":{"readyforshutdown":true,"shutdowntriggered":false,"pendingjobscount":0}}}

@harikrishna-patnala
harikrishna-patnala merged commit dd1c32c into apache:4.20Apr 14, 2025
@github-project-automationgithub-project-automationBot moved this from In Progress to Done in ACS 4.20.1Apr 14, 2025
@DaanHoogland
DaanHoogland deleted the ghi10565-apiLogger branch April 14, 2025 08:18
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
* undo removval of accessLogger and deal with some warnings
* Apply suggestions from code review
* add accesslog to servlet
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

API logs not generated in 4.20

8 participants

@DaanHoogland@blueorangutan@Pearl1594@gp-santos@yadvr@harikrishna-patnala@GutoVeronezi@JoaoJandre