readiness status API for clients #2844
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#2844
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We need an API that can be used to determine when a Tahoe client is connected to enough storage servers to do something useful and retrieve a file from the storage grid.
Similarly there should be a way to determine the readiness of storage nodes and introducers.
There are potentially many uses for such an API, for instance the integration tests should use it as should any Tahoe GUI we build.
i don't know much about writing http APIs but i was thinking to write a polling http api that outputs JSON and it looks like i could copy a lot of code from the magic folder status http api; anyway i wrote this is_ready method for Clients to determine if at least k storage servers are connected:
https://github.com/david415/tahoe-lafs/commits/2844.add_readiness_api.0
maybe this readiness doesn't make sense for storage servers? or would they be ready after they have announced themselves to at least one introducer or all introducers?
also, what would it mean for an introducer to be ready? they are always ready so perhaps this isn't meaningful for introducers.
The following is purely for the integration tests use-case (but I think also applies to e.g. Docker images etc).
The "is ready" is mostly about "are all the ports open and listening now" (for all non-client servers). That is, when we
spawnProcess
, that returns fairly rapidly -- such that if we spawn an Introducer and (without waiting) spawn a storage server, it will fail to connect to the Introducer. There are lots of different ways of tackling this (e.g. the integration tests could keep polling the ports they care about on the Introducer). Another way is what I'm doing currently: waiting for the "introducer running" (or similar) to appear in the stdout logs.Maybe there's really no better way than trolling stdout (in "some" defense this is one way systemd works -- waiting for
READY=1
to be printed by the launched process). I'm also kind of hoping there's "A Good Way" that people do this already...In any case, it would be good to standardize on something (the "introducer running" is a bit fragile-feeling, and the string changes depending on what kind of tahoe you launched).
A JSON API would let us return more-interesting statuses -- and then e.g. for an integration-test use-case, the tests would have to rapidly poll the API (and keep re-trying on connection errors etc).
We just discussed this in Ops meeting Nov 29, and concluded:
ok i made the http api work and unit tested as well:
https://github.com/david415/tahoe-lafs/tree/2844.add_readiness_api.1
i have not yet written the client side http API...
i'll do that soon. next.