Skip to content

Conversation

@sazzad16
Copy link
Contributor

An alternate implementation of #2352.

This approach copies the configuration parameters instead of saving the object reference.

Comment on lines +214 to +220
if (socketParamModified) { // this is only for backward compatibility
try {
disconnect();
} catch(Exception e) {
// swallow
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need disconnect() before connect().
i also think we should not swallow any exception, we need logger.error it.

Copy link
Contributor Author

@sazzad16 sazzad16 Feb 5, 2021

Choose a reason for hiding this comment

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

i also think we should not swallow any exception, we need logger.error it.

acknowledged

why do we need disconnect() before connect().

In current Jedis implementation, it is possible for users to change connection params after constructor. This block of code is present to support those implementations by recreating the connections if the params are changed.

@sazzad16
Copy link
Contributor Author

sazzad16 commented Feb 6, 2021

@yangbodong22011 Let's continue at #2368

@sazzad16 sazzad16 marked this pull request as draft February 6, 2021 14:45
@sazzad16 sazzad16 closed this Feb 17, 2021
@sazzad16 sazzad16 deleted the config-pattern-extend-2-2 branch May 18, 2021 13:14
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.

2 participants