Skip to content

remove request listener to prevent untimely session invalidation - #6393

Merged
nvazquez merged 6 commits into
apache:mainfrom
shapeblue:sessionCountProblems
May 24, 2022
Merged

nvazquez merged 6 commits into
apache:mainfrom
shapeblue:sessionCountProblems

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR removes the request handlin from the ApiSessionListener. This causes sessions to be invalidated. API calling from cmk would fail and succeed on and off due to this.

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)

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?

manually tested by listing accounts with cloudmonkey.

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@nvazquez a 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: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3414

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@weizhouapache weizhouapache 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.

verified OK

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@weizhouapache @nvazquez I am ok with this as a temporary fix, but it is a functional regression as sessions are no longer properly administrated. We (I) will have to think about a more premanent fix. I actually think the real bug is in the way the ApiServlet handles sessions and not this listener, but they seem to be incompatible :(

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-4195)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38984 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6393-t4195-kvm-centos7.zip
Smoke tests completed. 95 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 461.57 test_vpc_redundant.py

@sureshanaparti sureshanaparti 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.

code LGTM

Comment thread server/src/main/java/com/cloud/api/ApiSessionListener.java
@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6393 (SL-JID-1594)

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6393 (SL-JID-1595)

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a 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: ✔️ el7 ✔️ el8 ✖️ debian ✔️ suse15. SL-JID 3444

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6393 (SL-JID-1598)

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a 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: ✔️ el7 ✔️ el8 ✖️ debian ✔️ suse15. SL-JID 3446

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6393 (SL-JID-1599)

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a 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.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

tested @nvazquez @weizhouapache ,
both repeated listing of accounts and (with latency) session count works.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✖️ debian ✔️ suse15. SL-JID 3447

@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability B 2 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

} else if (HttpUtils.RESPONSE_TYPE_XML.equalsIgnoreCase(responseType)){
resp.setContentType(HttpUtils.XML_CONTENT_TYPE);
}
resp.setContentType(HttpUtils.XML_CONTENT_TYPE);

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.

@DaanHoogland should we force xml?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It wouldn´t matter in the existing code as line 179 (former version 168) https://github.com/apache/cloudstack/pull/6393/files#diff-cc92beff292fdad7835437d622159db6e1ae90d0ebac7fb4ae73c813faa8896eR179 hard-codes the reponseType to HttpUtils.RESPONSE_TYPE_XML. The second branch would always be executed.

@yadvr

yadvr commented May 20, 2022

Copy link
Copy Markdown
Member

Test cases suggested:

  • Normal login as different account/roles/types
  • Login/auth and run API using api-key and secret-keys
  • SAML based SSO login and logout
  • pre-shared key based running APIs

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-4218)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 41939 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6393-t4218-kvm-centos7.zip
Smoke tests completed. 96 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 463.57 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Failure 483.17 test_vpc_redundant.py

@yadvr

yadvr commented May 22, 2022

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian Build Failed (tid-4227)

@nvazquez

Copy link
Copy Markdown
Contributor

Hi @kohrar can you please verify the login/logout with this PR?

@nvazquez
nvazquez merged commit c123c3f into apache:main May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants