Syncthing: Cache device connection details between sessions

Created on 13 Apr 2020  路  3Comments  路  Source: syncthing/syncthing

This is an enhancement request. It鈥檚 goal is to make Syncthing less dependent on the discovery services always being available.

Syncthing should cache all the discovered connection details (protocol, ip, port) for each device. It enables devices to more quickly reconnect after a restart, and it makes them less dependent on the global discovery system. It also means Syncthing would continue to work for many devices during an outage with the Global Discovery system, or government interference with the internet (e.g. if a country disconnects from the global internet).

Local and Global Discovery should only be used in cases where the cached connection details don鈥檛 work. Before reconnection attempts, try the cached addresses, then discovery mechanisms. (Or do this in parallel.) Purge outdated cache entries on the next successful connection.

enhancement

Most helpful comment

Either way, I guess. But we already have an in-memory discovery cache with lifetimes and stuff. Persisting that to database just retains the behavior over restarts and shouldn't be rocket science.

All 3 comments

Sounds reasonable to me!

I don' think "cache all" makes sense, as due to quic/routers etc you might have hundreds of addresses, it would only make sense to cache the addresses we've connected successfully.

Either way, I guess. But we already have an in-memory discovery cache with lifetimes and stuff. Persisting that to database just retains the behavior over restarts and shouldn't be rocket science.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trymeouteh picture trymeouteh  路  4Comments

bobaxxx picture bobaxxx  路  4Comments

as-com picture as-com  路  3Comments

kakra picture kakra  路  3Comments

tomasz1986 picture tomasz1986  路  3Comments