You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "bigbird-0101 (via GitHub)" <gi...@apache.org> on 2024/09/26 12:55:02 UTC

[I] [Bug] future.sync.set default value error [dubbo]

bigbird-0101 opened a new issue, #14727:
URL: https://github.com/apache/dubbo/issues/14727

   ### Pre-check
   
   - [X] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Dubbo Version
   
   Dubbo:latest 
   
   ### Steps to reproduce this issue
   
   except: future.sync.set  default value=false
   why code default set true ?
   this code want to set false ,why? RpcContext.getServiceContext().setFuture(new FutureAdapter<>(asyncResult.getResponseFuture()));  this code  async to do when InvokeMode.ASYNC
   ` if (setFutureWhenSync || invocation.getInvokeMode() != InvokeMode.SYNC) {
               // set server context
               RpcContext.getServiceContext().setFuture(new FutureAdapter<>(asyncResult.getResponseFuture()));
           }`
   
   ### What you expected to happen
   
   except:future.sync.set  default value=false
   why code default set true ?
   this code want to set false ,why? RpcContext.getServiceContext().setFuture(new FutureAdapter<>(asyncResult.getResponseFuture()));  this code  async to do when InvokeMode.ASYNC
   ` if (setFutureWhenSync || invocation.getInvokeMode() != InvokeMode.SYNC) {
               // set server context
               RpcContext.getServiceContext().setFuture(new FutureAdapter<>(asyncResult.getResponseFuture()));
           }`
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [X] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] future.sync.set default value error [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #14727:
URL: https://github.com/apache/dubbo/issues/14727#issuecomment-2381069905

   > I see previous version, it is also default value = true, but I understand the default value here should be false
   
   In Dubbo 2.7 or 3.0, there is no way to disable set future by default. In order to prevent memory leak in some scenarios, we support a way to disable it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] future.sync.set default value error [dubbo]

Posted by "bigbird-0101 (via GitHub)" <gi...@apache.org>.
bigbird-0101 commented on issue #14727:
URL: https://github.com/apache/dubbo/issues/14727#issuecomment-2381067082

   I see  previous version, it  is also default value = true, but  I understand the default value here should be false


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] future.sync.set default value error [dubbo]

Posted by "bigbird-0101 (via GitHub)" <gi...@apache.org>.
bigbird-0101 commented on issue #14727:
URL: https://github.com/apache/dubbo/issues/14727#issuecomment-2417008568

   > I have created a new branch for `3.4`. You can submit a PR to that~
   PR is commited   [https://github.com/apache/dubbo/pull/14785](https://github.com/apache/dubbo/pull/14785)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] future.sync.set default value error [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed issue #14727: [Bug] future.sync.set default value error   
URL: https://github.com/apache/dubbo/issues/14727


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] future.sync.set default value error [dubbo]

Posted by "bigbird-0101 (via GitHub)" <gi...@apache.org>.
bigbird-0101 commented on issue #14727:
URL: https://github.com/apache/dubbo/issues/14727#issuecomment-2381073005

   > > I see previous version, it is also default value = true, but I understand the default value here should be false
   > 
   > In Dubbo 2.7 or 3.0, there is no way to disable set future by default. In order to prevent memory leak in some scenarios, we support a way to disable it.
   Yes, I encountered a memory leak scenario, so I paid attention to this problem. However, the current solution provided by versions after 3.0 is not very good. The future is still set by default. The expectation is that the future is not set, and I saw that paragraph.
   
   The default value expected by the code is false, which means that future is not set to prevent memory leaks.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] future.sync.set default value error [dubbo]

Posted by "bigbird-0101 (via GitHub)" <gi...@apache.org>.
bigbird-0101 commented on issue #14727:
URL: https://github.com/apache/dubbo/issues/14727#issuecomment-2381074353

   > > I see previous version, it is also default value = true, but I understand the default value here should be false
   > 
   > In Dubbo 2.7 or 3.0, there is no way to disable set future by default. In order to prevent memory leak in some scenarios, we support a way to disable it.
   
   this is old code:
   ```java
       private static final boolean setFutureWhenSync = Boolean.parseBoolean(System.getProperty(CommonConstants.SET_FUTURE_IN_SYNC_MODE, "true"));
   ```
   
   Except code:
   ```java
       private static final boolean setFutureWhenSync = Boolean.parseBoolean(System.getProperty(CommonConstants.SET_FUTURE_IN_SYNC_MODE, "false"));
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] future.sync.set default value error [dubbo]

Posted by "bigbird-0101 (via GitHub)" <gi...@apache.org>.
bigbird-0101 commented on issue #14727:
URL: https://github.com/apache/dubbo/issues/14727#issuecomment-2381072240

   Yes, I encountered a memory leak scenario, so I paid attention to this problem. However, the current solution provided by versions after 3.0 is not very good. The future is still set by default. The expectation is that the future is not set, and I saw that paragraph.
   
   The default value expected by the code is false, which means that future is not set to prevent memory leaks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] future.sync.set default value error [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #14727:
URL: https://github.com/apache/dubbo/issues/14727#issuecomment-2381064619

   To compact to previous version


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org