How to decide resubscribe interval for client observers #9416
-
Hello, If i store the observer identities in persisted state in the grain so that they can be recovered if the silo restarts, is the "stale timeout" the only thing that affects my resubscribe interval? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @klasrpersson the validity of an observer reference is tied to the lifecycle of the observer (eg client) itself, and not the silo. They can survive silo restarts but not client restarts. The resubscribe interval is used as a cleanup mechanism for observers which either point to defunct clients or have been disposed by the client (eg, the reference has gone out of scope and has been garbage-collected). A short interval means you have network chattiness & overhead. A large interval means you hold onto defunct references for a longer period after they become invalid, possibly resulting in error or warning logs. The need for a cleanup interval arises from the observer methods being |
Beta Was this translation helpful? Give feedback.
Hi @klasrpersson the validity of an observer reference is tied to the lifecycle of the observer (eg client) itself, and not the silo. They can survive silo restarts but not client restarts.
The resubscribe interval is used as a cleanup mechanism for observers which either point to defunct clients or have been disposed by the client (eg, the reference has gone out of scope and has been garbage-collected). A short interval means you have network chattiness & overhead. A large interval means you hold onto defunct references for a longer period after they become invalid, possibly resulting in error or warning logs.
The need for a cleanup interval arises from the observer methods being
void
an…