- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3.9k
 
Fix connection leak in scanIteration with JedisSentineled #4323 #4328
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
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            4 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      ce55829
              
                docs: document required optional dependency `resilience4j-all` when u…
              
              
                ggivo 322d612
              
                Fix connection leak in scanIteration with JedisSentineled
              
              
                ggivo 8b76086
              
                Merge branch 'master' into ggivo/4323-sentineled-scan-leak
              
              
                ggivo d296279
              
                Merge branch 'master' into ggivo/4323-sentineled-scan-leak
              
              
                ggivo File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            57 changes: 57 additions & 0 deletions
          
          57 
        
  ...java/redis/clients/jedis/commands/unified/sentinel/SentinelAllKindOfValuesCommandsIT.java
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| package redis.clients.jedis.commands.unified.sentinel; | ||
| 
     | 
||
| import org.junit.jupiter.api.extension.RegisterExtension; | ||
| import org.junit.jupiter.params.ParameterizedClass; | ||
| import org.junit.jupiter.params.provider.MethodSource; | ||
| import redis.clients.jedis.DefaultJedisClientConfig; | ||
| import redis.clients.jedis.EndpointConfig; | ||
| import redis.clients.jedis.HostAndPort; | ||
| import redis.clients.jedis.HostAndPorts; | ||
| import redis.clients.jedis.JedisClientConfig; | ||
| import redis.clients.jedis.JedisSentineled; | ||
| import redis.clients.jedis.RedisProtocol; | ||
| import redis.clients.jedis.UnifiedJedis; | ||
| import redis.clients.jedis.commands.unified.AllKindOfValuesCommandsTestBase; | ||
| import redis.clients.jedis.util.EnabledOnCommandCondition; | ||
| import redis.clients.jedis.util.RedisVersionCondition; | ||
| 
     | 
||
| import java.util.Arrays; | ||
| import java.util.HashSet; | ||
| import java.util.Set; | ||
| 
     | 
||
| @ParameterizedClass | ||
| @MethodSource("redis.clients.jedis.commands.CommandsTestsParameters#respVersions") | ||
| public class SentinelAllKindOfValuesCommandsIT extends AllKindOfValuesCommandsTestBase { | ||
| 
     | 
||
| static final HostAndPort sentinel1 = HostAndPorts.getSentinelServers().get(1); | ||
| 
     | 
||
| static final HostAndPort sentinel2 = HostAndPorts.getSentinelServers().get(3); | ||
| 
     | 
||
| static final Set<HostAndPort> sentinels = new HashSet<>(Arrays.asList(sentinel1, sentinel2)); | ||
| 
     | 
||
| static final JedisClientConfig sentinelClientConfig = DefaultJedisClientConfig.builder().build(); | ||
| 
     | 
||
| static final EndpointConfig primary = HostAndPorts.getRedisEndpoint("standalone2-primary"); | ||
| 
     | 
||
| @RegisterExtension | ||
| public RedisVersionCondition versionCondition = new RedisVersionCondition( | ||
| primary.getHostAndPort(), primary.getClientConfigBuilder().build()); | ||
| 
     | 
||
| @RegisterExtension | ||
| public EnabledOnCommandCondition enabledOnCommandCondition = new EnabledOnCommandCondition( | ||
| primary.getHostAndPort(), primary.getClientConfigBuilder().build()); | ||
| 
     | 
||
| public SentinelAllKindOfValuesCommandsIT(RedisProtocol protocol) { | ||
| super(protocol); | ||
| } | ||
| 
     | 
||
| @Override | ||
| protected UnifiedJedis createTestClient() { | ||
| 
     | 
||
| return JedisSentineled.builder() | ||
| .clientConfig(primary.getClientConfigBuilder().protocol(protocol).build()) | ||
| .sentinels(sentinels).sentinelClientConfig(sentinelClientConfig).masterName("mymaster") | ||
| .build(); | ||
| } | ||
| 
     | 
||
| } | 
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.