You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "frozenNoob (via GitHub)" <gi...@apache.org> on 2025/09/18 07:48:00 UTC

[I] [Bug] In multi-threaded parallel execution, a large number of read only operations waste a lot of unnecessary time because the combination of "read and write" operations requires "serialization". [dubbo]

frozenNoob opened a new issue, #15665:
URL: https://github.com/apache/dubbo/issues/15665

   ### 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 feature requirement.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Descriptions
   
   The issues with the first approach (https://github.com/apache/dubbo/commit/c8a8946f89ef7f1d3bb9725f754465c6bb675834) are as follows:
   
   1. If a large number of read-only operations flood in, it is not appropriate for the first approach to wrap the read-write combination into an atomic operation. This will cause those read-only operations to be executed serially, which is very time-consuming (imagine 10K threads executing the `compute` method’s write operation serially due to the lock imposed by `synchronized`).
   2. I believe that in this load balancing algorithm, although the first approach can guarantee consistency, it cannot fundamentally prevent errors. For example: in the time window between the execution of the `compute` method and the `return` of the `doSelect` function, if another thread modifies the service list and rebuilds the corresponding values on the hash ring, then the result returned by the `select` method may be a stale node, which will still trigger subsequent fault-tolerance and retry mechanisms. Of course, since the average time complexity of a `TreeMap` query is O(log n), this time window is short but still exists.
   
   ### Related issues
   
   _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] [Feature] In multi-threaded parallel execution, a large number of read only operations waste a lot of unnecessary time because the combination of "read and write" operations requires "serialization". [dubbo]

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

   This issue should be classified as a bug.


-- 
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] [Feature] In multi-threaded parallel execution, a large number of read only operations waste a lot of unnecessary time because the combination of "read and write" operations requires "serialization". [dubbo]

Posted by "frozenNoob (via GitHub)" <gi...@apache.org>.
frozenNoob closed issue #15665: [Feature] In multi-threaded parallel execution, a large number of read only operations waste a lot of unnecessary time because the combination of "read and write" operations requires "serialization".
URL: https://github.com/apache/dubbo/issues/15665


-- 
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] In multi-threaded parallel execution, a large number of read only operations waste a lot of unnecessary time because the combination of "read and write" operations requires "serialization". [dubbo]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw closed issue #15665: [Bug] In multi-threaded parallel execution, a large number of read only operations waste a lot of unnecessary time because the combination of "read and write" operations requires "serialization".
URL: https://github.com/apache/dubbo/issues/15665


-- 
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