Draft: Memory reconnects
1 unresolved thread
1 unresolved thread
Closes #80
Merge request reports
Activity
Filter activity
I implemented a small test scenario
memory_reconnect_test
with amemory_reconnect_test_client
and amemory_reconnect_test_server
. You can start it together with theArMemCore
scenario (which starts the MNS etc).The server is just an empty memory server with a name.
The client gets a reader to the server and performs
n
queries at a given frequencyYou can configure the client:
- Whether it should use
getReader()
oruseReader()
(propertyaddDependency
) - Whether it should stop queries after a disconnect (property
stopQueriesOnDisconnect
) - Whether the query task should be restarted after a reconnect (though this shouldn't have any effect)
- The number of queries (
queries.num
). Use -1 for infinite. - The frequency of queries (
queries.frequency
)
For example, you can set to infinite queries (-1) at 20 Hz and observe what happens when you stop the server.
I observed the following behaviors:
-
add dependency / stop at disconnect (restart at reconnect has no effect as task is always stopped)
- One query fails the moment the server disconnects (indicated by
result.success == false
) and queries stop - After server restart, queries start again
- Repeat
- One query fails the moment the server disconnects (indicated by
-
add dependency / no stop at disconnect / restart at reconnect
- One query fails before the component disconnects.
- After the disconnect (before the reconnect), all further queries fail (
result.success == false
) - After a reconnect, and after the query thread was restarted, the queries succeed again
-
add dependency / no stop at disconnect / no restart at reconnect
- Same as with restart at reconnect
-
no dependency (no disconnects)
- After the server stops, all queries fail.
- When the server is back online, the queries continue to fail (same error). This is not optimal.
So:
- We need to recreate the proxies/readers after reconnecting to the server; the old proxy objects are not valid anymore.
- If this is done in
onConnect()
, and youuse
the server, this should be fine; given that your code can handle failed queries and the re-setup. - If you just
get
a client and the server is gone, you will currently loose connection and not regain it.
Edited by Rainer Kartmann- Whether it should use
@dreher @fabian.reister
Please register or sign in to reply