Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
CFE-2678: Global connection cache #3515
Currently the connection cache is destroyed after each bundle pass. In our usage of the agent (where we can have quite a lot of file copies all in different bundles), this leads to slower execution time and an increased load on the server (with up to tens of connections created and destroyed during a single run).
This patch naively activates the connection cache at the agent run level. This appears to have been held back (https://tracker.mender.io/browse/CFE-2678) because of https://tracker.mender.io/browse/CFE-2511, and waiting for a way to avoid reusing broken connections.
I could work on this as we really want to have a working connection cache. Does the solution proposed in CFE-2511 description suits you, and would allow reusing the connection cache for a whole agent run?
Currently the connection cache is reset after each bundle pass. This limits its effectivity, as all policies do not group file copies in the same bundle pass. This was apprently done to limit the risk of reusing broken connections. This commit keeps a unique connection cache for the whole agent run, and adds an error detection mechanism to avoid reusing broken cached connections.