Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Cache version string in versionstring.py #5672

@michaelkaye

Description

@michaelkaye

Description

https://github.com/matrix-org/synapse/blob/develop/synapse/federation/transport/server.py#L773

Synapse does not cache it's version string on startup, causing requests to that endpoint to cause 4 git processes to be spawned, even if the code is not deployed via git.

https://github.com/matrix-org/synapse/blob/develop/synapse/util/versionstring.py

While we're at it, we probably don't need to do that caching at each of the places get_version_string is called - perhaps that function saves the response forever (during the lifetime of the python process), this will save us checking git multiple times on startup - we just need to try it that 4 times and that's it.

We also tack on the "Synapse/" in lots of the places that we do this as well, maybe just do that in one place too.

Version information

  • Version: develop

  • Install method:
    git clone

  • Platform:
    linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-PerformancePerformance, both client-facing and admin-facingz-p2(Deprecated Label)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions