imzhenyu/rDSN

task code defined in multiple places

qinzuoyan opened this issue · 3 comments

Including:

  • _RPC_CM_QUERY_PARTITION_CONFIG_BY_INDEX_ defined both in replication.codes.h and partition_resolver_simple.cpp, using different task pool.
  • _RPC_L2_CLIENT_READ_ and _RPC_L2_CLIENT_WRITE_ defined both in service_engine.cpp and replication_service_app.cpp, using different task pool and priority.

Why? will it cause problems? @imzhenyu

This is by design. Essentially, the idea is to override the default priorities and pools for a task code defined in core. We can do that in config file. However, since the override is enforced by replication, we hard code them in the code. There won't be problems if the core and the replication libraries are defined in different .so/.dll, but it may cause problem when they are linked into one single binary. I will not recommend the later usage, which is also not a good idea to keep boundaries across modules.

Yes, if linked into one single binary, the final value will depends on the
linking order of object files, which is undefined for most compilers.

On Thu, Jun 30, 2016 at 10:13 AM, Zhenyu Guo notifications@github.com
wrote:

This is by design. Essentially, the idea is to override the default
priorities and pools for a task code defined in core. We can do that in
config file. However, since the override is enforced by replication, we
hard code them in the code. There won't be problems if the core and the
replication libraries are defined in different .so/.dll, but it may cause
problem when they are linked into one single binary. I will not recommend
the later usage, which is also not a good idea to keep boundaries across
modules.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#426 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAgQPXg2Yx7_9O7Fr_pK_ABeQym-8pGRks5qQyZCgaJpZM4JBuq0
.

So for the later case, the current approach is to override these options in config files to avoid the problems mentioned above.