Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design and implementation details clarification request around rtcache #70

Open
mikolaj-staworzynski-red opened this issue Oct 7, 2022 · 0 comments

Comments

@mikolaj-staworzynski-red
Copy link
Contributor

mikolaj-staworzynski-red commented Oct 7, 2022

Hi,

I have couple of questions related to rtcache submodule. Some of the aspects of implementation looks very strange for me:

(1) Why the file: https://github.com/rdkcentral/xdialserver/blob/master/server/plat/rtRemoteObjectCache.hpp is here ?
Is it not a part of rtRemote API provided here: https://github.com/pxscene/rtRemote/blob/master/include/rtRemoteObjectCache.h ?

(2) Id mapping for the cache: https://github.com/rdkcentral/xdialserver/blob/master/server/plat/rtcache.cpp#L25
What is the reason of introducing such a mapping - looks like "Dial" prefixed names are there, but only for YouTube and Netflix ?
Why all the others are mapped to "INVALID" ?
Could it be done in a straight forward way without that strange name remap ?
I mean application name should be an identifier in the ObjectCache ?

(3) rtRemoteObjectCache cache object created by rtcache: https://github.com/rdkcentral/xdialserver/blob/master/server/plat/rtcache.hpp#L36 works in the very strange way.

My observation is the following:

3.1 Object are cached there for the time equal to setup of rt.rpc.cache.max_object_lifetime= later they disappear from there when there are no additional application state refresh, it happens in the following line of code: https://github.com/pxscene/rtRemote/blob/master/src/rtRemoteServer.cpp#L376
Reason of that is, even if we have two instances of the rtRemoteObjectCache, both of them share the same map: https://github.com/pxscene/rtRemote/blob/master/src/rtRemoteObjectCache.cpp#L50

3.2 Cached object are not in scope of keep alive mechanism for rtRemote, to make that happens they should be registrered in the xcast (rtRemoteRegisterObject) and located in xdial (rtRemoteLocateObject), otherwise keep alive does not work for them.

As a result of 3.1 and 3.2 we have the following strange behaviour:
If we start, let's say Netflix and receive "running" state for Netflix object will be cached, after time defined by: rt.rpc.cache.max_object_lifetime= object will disappear from cache.
Later on, after rt.rpc.cache.max_object_lifetime time, if we would like to do the stop/ or hide there are no state at all in the cache.

My question is the following: What is a reason of introducing such a strange solution here, that appears to me like being a bug, but maybe I do not know yet all the aspects.
Please clarify that if you could, maybe there are some not yet discovered places here that I should know about and not yet discovered by me.

Is the cache keep aliving/refreshing mechanism for the objects in the rtcache base on a little bit hidden assumption that the 2nd screen application periodically doing GET requests for the state of the application ? Every 10-20 seconds ? for example GET /apps/Netflix or GET /apps/YouTube ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant