Skip to content
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

Tags: Add session export/import capabilities #7464

Merged
merged 4 commits into from
Apr 6, 2018
Merged

Tags: Add session export/import capabilities #7464

merged 4 commits into from
Apr 6, 2018

Conversation

vancluever
Copy link
Contributor

@vancluever vancluever commented Mar 6, 2018

This creates helpers for exporting session IDs out of the tag package's REST client.

This allows programs to re-use sessions that are created using the REST client (a feature that already exists in https://github.com/vmware/govmomi/tree/master/govc), allowing clients that make use of the features to scale to a large amount of operations made over multiple single invocations of an external program - without stressing the server - by ensuring that new sessions are not created for every operation.

The functionality is a simple export of the session cookie value and a re-import of the cookie after the fact. Valid checks against the existing session using the ?~action=get query string to verify validity.


This is being done as we are having issues in https://github.com/terraform-providers/terraform-provider-vsphere that seem to be coming up due to rejected logins in the middle of a full sweep of our acceptance tests, which due to how they are run, end up running a brand new instance of the provider connection several times, even during a single test. We hit session limits in the SOAP API and the error messages from the REST API such as Rejecting login on a session where login failed leads me to believe that a similar thing is happening in the REST API.

This adds session ID export/import functionality to facilitate session
re-use. This is important during highly concurrent or successive
operations to prevent the REST API from returning errors.
Copy link
Contributor

@hmahmood hmahmood left a comment

Choose a reason for hiding this comment

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

Looks good to me, but would like @dougm to review this too.

Copy link
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

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

Very nice, had been hoping to see this functionality (#6376 (comment))

@vancluever
Copy link
Contributor Author

Thanks all! Just made a couple of grammar fixes to the function docs too.

Copy link
Member

@hickeng hickeng left a comment

Choose a reason for hiding this comment

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

Approved.

@dougm I would like to discuss moving the tags package into govmomi.
It's a misnomer given it's not part of vmomi so I'm somewhat on the fence, but govmomi is being used to expose various function beyond the vmomi API already iirc and this is at the same functional level.

@dougm
Copy link
Member

dougm commented Mar 14, 2018

@hickeng yes, had started discussing this with @markpeek and others. There have also been requests for govc to support tags vmware/govmomi#957 and content library vmware/govmomi#735

@codecov-io
Copy link

Codecov Report

Merging #7464 into master will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #7464      +/-   ##
=========================================
+ Coverage   31.42%   31.5%   +0.08%     
=========================================
  Files         282     282              
  Lines       42168   42168              
=========================================
+ Hits        13252   13287      +35     
+ Misses      27757   27720      -37     
- Partials     1159    1161       +2
Impacted Files Coverage Δ
pkg/logmgr/logmgr.go 67.36% <0%> (+1.38%) ⬆️
lib/portlayer/attach/communication/interactor.go 27% <0%> (+2.91%) ⬆️
lib/portlayer/attach/communication/connector.go 61.68% <0%> (+7.47%) ⬆️
lib/portlayer/attach/communication/lazy.go 90.9% <0%> (+22.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e941401...f58cd63. Read the comment docs.

@hickeng hickeng merged commit 184d9b5 into vmware:master Apr 6, 2018
rajanashok pushed a commit to rajanashok/vic that referenced this pull request Apr 26, 2018
This adds session ID export/import functionality to facilitate session
re-use. This is important during highly concurrent or successive
operations to prevent the REST API from returning errors.
rajanashok pushed a commit to rajanashok/vic that referenced this pull request Apr 26, 2018
This adds session ID export/import functionality to facilitate session
re-use. This is important during highly concurrent or successive
operations to prevent the REST API from returning errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants