Skip to content

Conversation

@marcaurele
Copy link
Member

@marcaurele marcaurele commented Oct 31, 2019

Description

Related to #2329 (comment) the session timeout is not taken into account. This change creates a session handler explicitly and the timeout value should be correctly taken into account.

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)

How Has This Been Tested?

This has not been tested yet.

@andrijapanicsb
Copy link
Contributor

thx! let me test that

@andrijapanicsb
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@andrijapanicsb a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-334

@andrijapanicsb
Copy link
Contributor

@blueorangutan test matrix

@blueorangutan
Copy link

@andrijapanicsb a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

Hi @marcaurele thanks for the changes. I tested this but unfortunately I couldn't see any difference after changing the value on server.properties and restarting the management server

@blueorangutan
Copy link

Trillian test result (tid-438)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34872 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3658-t438-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 77 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

Trillian test result (tid-439)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 35868 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3658-t439-vmware-65u2.zip
Smoke tests completed. 77 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@andrijapanicsb andrijapanicsb left a comment

Choose a reason for hiding this comment

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

Unfortunately, not working @marcaurele 😢

@marcaurele
Copy link
Member Author

I did some testing on a simple server and I had to set the timeout after the server was started. I pushed an update, let me know if it's working now @andrijapanicsb

@andrijapanicsb
Copy link
Contributor

thx @marcaurele.

@blueorangutan package

@blueorangutan
Copy link

@andrijapanicsb a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-335

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

Thanks @marcaurele, this is working now but I think it can be improved a bit:

Instead of creating a pair to pass the sessionHandler, it can be defined as a variable and set the timeout after the server starts, reducing the lines of code:

private SessionHandler sessionHandler;

...

private HandlerCollection createHandlers() {
   ...
   sessionHandler = webApp.getSessionHandler();
   ...
}

public void start() {
   ...
   server.start();
   // Must set the session timeout after the server has started
   sessionHandler.setMaxInactiveInterval(sessionTimeout * 60);
   ...
}

@andrijapanicsb
Copy link
Contributor

@marcaurele @nvazquez - I've tested both your solutions - it works fine! (tried both setting session to 2minutes and 45 minutes) - so all good!

@nvazquez
Copy link
Contributor

nvazquez commented Nov 4, 2019

@marcaurele please check PR #3663

@andrijapanicsb andrijapanicsb mentioned this pull request Nov 4, 2019
5 tasks
@marcaurele
Copy link
Member Author

@nvazquez IMO it does not look well coded to keep a reference of the SessionHandler as a class member to only skip having to return this pair of objects.
Then, I don't understand why you open a new PR to perform those changes? Is that so urgent? Aren't your comment enough?

@nvazquez
Copy link
Contributor

nvazquez commented Nov 4, 2019

@marcaurele no urgency, was trying to propose an improvement and tried with the comments but thought those were not being added until I click Submit on the review. So I created the PR for clarity but didn't realise the comments were already added, please discard them. Thanks for the fix

@andrijapanicsb
Copy link
Contributor

Guys, please let me know once you have agreed on the way forward, so I can merge this one.

@nvazquez
Copy link
Contributor

nvazquez commented Nov 5, 2019

I have closed the other PR, I'm ok with this one

@marcaurele marcaurele changed the title WIP: client: explicitly create a session handler to set session timeout client: explicitly create a session handler to set session timeout Nov 5, 2019
@marcaurele
Copy link
Member Author

@nvazquez I wish we could return multiple argument without creating a custom class in Java. Thanks for taking my point in consideration.

@marcaurele marcaurele changed the title client: explicitly create a session handler to set session timeout client: fix for jetty session timeout Nov 5, 2019
@marcaurele
Copy link
Member Author

Rebase done to only leave the good commit. Good for review & merge on my side.

@nvazquez
Copy link
Contributor

nvazquez commented Nov 5, 2019

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-339

@nvazquez
Copy link
Contributor

nvazquez commented Nov 5, 2019

@blueorangutan test matrix

@blueorangutan
Copy link

@nvazquez a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-452)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 42011 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3658-t452-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 77 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@andrijapanicsb
Copy link
Contributor

the latest code is NOT ok.
I've set timeout to 2 minutes and I don't get logged out on 2m30sec (nor on 3m30sec nor on 4m15sec - tested just in case...)

@yadvr
Copy link
Member

yadvr commented Nov 6, 2019

@marcaurele
Copy link
Member Author

@andrijapanicsb weird as I don't see any difference so far from the previous 2 commits. Can you double check you're using the right branch and cleared up the compiled classes of the client module, just in case.

@rhtyd that's what it's doing, but I found out that the session must be set after doing the server.start(). I modified the jetty example embbeded project to try out.

@andrijapanicsb
Copy link
Contributor

my bad, give me 2 minutes...

@andrijapanicsb
Copy link
Contributor

all good @marcaurele.

LGTM from my side (manual testing).

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

LGTM

@andrijapanicsb
Copy link
Contributor

merging based on 2 LGTM, manual testing and automated test results.

thx @marcaurele !

@andrijapanicsb andrijapanicsb merged commit afab9fb into apache:master Nov 6, 2019
@marcaurele
Copy link
Member Author

For the record, this is the small embedded app to validate: https://github.com/marcaurele/embedded-jetty-uber-jar/tree/session-test

@marcaurele marcaurele deleted the session-handler branch November 6, 2019 17:06
@andrijapanicsb andrijapanicsb added this to the 4.14.0.0 milestone Dec 10, 2019
DaanHoogland pushed a commit that referenced this pull request Jan 3, 2020
fixed inability to set a custom session duration via server.properties on mgmt server.
DaanHoogland added a commit that referenced this pull request Jan 7, 2020
* 4.13:
  only update powerstate if sure it is the latest (#3743)
  ui: fix migrate host form no host popup (#3682)
  client: jetty session timeout set after server is started (#3658)
  Increase DHCP lease time to infinite (#3662)
ustcweizhou pushed a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
fixed inability to set a custom session duration via server.properties on mgmt server.
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