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

Describe pool session management #454

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

smallhive
Copy link
Contributor

close #449

@smallhive smallhive marked this pull request as ready for review June 27, 2023 10:40
@@ -61,6 +63,21 @@ func (x PrmObjectDelete) GetSession() (*session.Object, error) {
return &sess, nil
}

// IsAutoSessionEnabled is an indicator for Pool.
Copy link
Member

Choose a reason for hiding this comment

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

But it's a client thing, it shouldn't care about pool.

We already have WithinSession, it can override pool behavior for the case when the session is used. We only need a way to explicitly remove the same session. Either it's a WithinSession(nil) or a separate method (DropSession()). Then it can be a bool internally (isSessionSet) and maybe a special error from GetSession() to separate ErrNoSession and ErrNoSessionExplicitly. Then all of this is completely generic client thing, but pool can use these functions as needed for its magic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed DropSession with IgnoreSession, I think this is more neutral. But I tend to think we need to add some description, that this function does nothing for a single client

Copy link
Member

Choose a reason for hiding this comment

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

It can do something for a single client! Suppose you've used WithinSession() somewhere and now you can IgnoreSession() as well to remove it.

Naming is hard, we know, IgnoreSession is not bad, but ideally we should somehow signify that this function in many ways is an antonym to WithinSession.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WithinSession / IgnoreSession looks like antipodes. But added some comments to func docs

client/object_delete.go Show resolved Hide resolved
client/object_get.go Show resolved Hide resolved
pool/doc.go Outdated Show resolved Hide resolved
pool/object.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the 449-describe-pool-session-management branch 2 times, most recently from 4349abf to c05e575 Compare June 28, 2023 08:32
client/object_put.go Outdated Show resolved Hide resolved
client/object_hash.go Outdated Show resolved Hide resolved
client/object_hash.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the 449-describe-pool-session-management branch 2 times, most recently from 8bcaa0b to 4323119 Compare June 29, 2023 12:22
@@ -25,42 +24,13 @@ var (

// PrmObjectDelete groups optional parameters of ObjectDelete operation.
type PrmObjectDelete struct {
sessionContainer
meta v2session.RequestMetaHeader
Copy link
Member

Choose a reason for hiding this comment

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

This creates a split brain situation with two metas.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is obviously excess. Removed


// GetSession returns session object.
//
// Returns ErrNoSession err if session wasn't set.
Copy link
Member

Choose a reason for hiding this comment

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

[ErrNoSession] or [ErrNoSessionExplicitly] if IgnoreSession was used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@smallhive smallhive force-pushed the 449-describe-pool-session-management branch from 4323119 to 949a242 Compare June 30, 2023 04:45
client/object_put.go Outdated Show resolved Hide resolved
pool/doc.go Show resolved Hide resolved
@smallhive smallhive force-pushed the 449-describe-pool-session-management branch from 949a242 to 37c1591 Compare July 4, 2023 06:30
@smallhive smallhive requested a review from carpawell July 4, 2023 06:32
client/session_container.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the 449-describe-pool-session-management branch from 37c1591 to a9226b0 Compare July 5, 2023 05:32
@smallhive smallhive force-pushed the 449-describe-pool-session-management branch from a9226b0 to da19bbc Compare July 6, 2023 05:20
@smallhive smallhive force-pushed the 449-describe-pool-session-management branch from da19bbc to 42e02b3 Compare July 6, 2023 09:45
@cthulhu-rider cthulhu-rider merged commit 7edf97f into master Jul 6, 2023
@cthulhu-rider cthulhu-rider deleted the 449-describe-pool-session-management branch July 6, 2023 10:16
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.

Describe pool session management and provide a knob to turn it off
4 participants