Uploaded image for project: 'Spring Data Redis'
  1. Spring Data Redis
  2. DATAREDIS-1027

LettuceConnectionFactory.destroy() should release reactiveConnectionProvider resources

    Details

      Description

      // code placeholder
      public void destroy() {
      
         resetConnection();
      
         if (connectionProvider instanceof DisposableBean) {
            try {
               ((DisposableBean) connectionProvider).destroy();
            } catch (Exception e) {
      
               if (log.isWarnEnabled()) {
                  log.warn(connectionProvider + " did not shut down gracefully.", e);
               }
            }
         }
      
         try {
            Duration timeout = clientConfiguration.getShutdownTimeout();
            client.shutdown(timeout.toMillis(), timeout.toMillis(), TimeUnit.MILLISECONDS);
         } catch (Exception e) {
      
            if (log.isWarnEnabled()) {
               log.warn((client != null ? ClassUtils.getShortName(client.getClass()) : "LettuceClient")
                     + " did not shut down gracefully.", e);
            }
         }
      
         if (clusterCommandExecutor != null) {
      
            try {
               clusterCommandExecutor.destroy();
            } catch (Exception ex) {
               log.warn("Cannot properly close cluster command executor", ex);
            }
         }
      }
      

      should we need to invoke destroy method of reactiveConnectionProvider object to release resources?

        Attachments

          Activity

            People

            • Assignee:
              mp911de Mark Paluch
              Reporter:
              Kevin Qian Kevin Qian
              Last updater:
              Mark Paluch
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: