Merge lp:~marcustomlinson/unity-scopes-api/locate_fix into lp:unity-scopes-api

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Michi Henning
Approved revision: 232
Merged at revision: 232
Proposed branch: lp:~marcustomlinson/unity-scopes-api/locate_fix
Merge into: lp:unity-scopes-api
Diff against target: 35 lines (+9/-4)
2 files modified
src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp (+1/-1)
src/scopes/internal/zmq_middleware/ZmqObject.cpp (+8/-3)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-api/locate_fix
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michi Henning (community) Approve
Review via email: mp+228481@code.launchpad.net

Commit message

Fixed invoke_twoway_() to not call locate() when targeting the registry or the SS registry

To post a comment you must log in.
232. By Marcus Tomlinson

Added TODO

Revision history for this message
Michi Henning (michihenning) wrote :

As an interim fix, this will help. I really need to get around to reworking the message pump :-(

Marcus, and you please top-approve yourself once Jenkins is happy with it? It's getting late here...

review: Approve
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> As an interim fix, this will help. I really need to get around to reworking
> the message pump :-(
>
> Marcus, and you please top-approve yourself once Jenkins is happy with it?
> It's getting late here...

"getting late"? Its been late there for a while now! :P
Thanks Michi!

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp'
2--- src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2014-07-21 15:45:02 +0000
3+++ src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2014-07-28 13:07:03 +0000
4@@ -841,7 +841,7 @@
5 // TODO: get pool size from config
6 // NB: On rebind, locate() is called on this adapter. A scope may then call registry methods during
7 // its start() method, hence we must ensure this adapter has enough threads available to handle this.
8- pool_size = 6;
9+ pool_size = 11;
10 mode = RequestMode::Twoway;
11 }
12 else
13
14=== modified file 'src/scopes/internal/zmq_middleware/ZmqObject.cpp'
15--- src/scopes/internal/zmq_middleware/ZmqObject.cpp 2014-07-21 07:29:51 +0000
16+++ src/scopes/internal/zmq_middleware/ZmqObject.cpp 2014-07-28 13:07:03 +0000
17@@ -209,10 +209,15 @@
18 ZmqReceiver ZmqObjectProxy::invoke_twoway_(capnp::MessageBuilder& out_params, int64_t timeout)
19 {
20 auto registry_proxy = mw_base()->registry_proxy();
21-
22- // If a registry is configured and this object is not the registry itself,
23+ auto ss_registry_proxy = mw_base()->ss_registry_proxy();
24+
25+ // TODO: HACK: this builds knowledge about the smartscopes proxy running permanently into the run time.
26+ bool this_is_registry = registry_proxy && identity() == registry_proxy->identity();
27+ bool this_is_ss_registry = ss_registry_proxy && identity() == ss_registry_proxy->identity();
28+
29+ // If a registry is configured and this object is not a registry itself,
30 // attempt to locate the scope before invoking it.
31- if (registry_proxy && identity() != registry_proxy->identity())
32+ if (!this_is_registry && !this_is_ss_registry)
33 {
34 try
35 {

Subscribers

People subscribed via source and target branches

to all changes: