Visitar URL original
Cephmount thread pool followups by rawe0 · Pull Request #5969 · cs3org/reva · GitHub
Skip to content

Cephmount thread pool followups - #5969

Open
rawe0 wants to merge 5 commits into
masterfrom
cephmount-thread-pool-followups
Open

rawe0 wants to merge 5 commits into
masterfrom
cephmount-thread-pool-followups

Conversation

@rawe0

@rawe0 rawe0 commented Oct 28, 2026

Copy link
Copy Markdown
Member

No description provided.

@update-docs

update-docs Bot commented Oct 28, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@rawe0
rawe0 added this pull request to stack #5971 October 28, 2026 22:14
rawe0 added 4 commits October 30, 2026 16:23
The cleanup stopped a thread after 5 minutes without activity, also
while a request (for example a large upload) still ran on it. The
response of that request could then be lost, and the requests in the
queue never ran, so their callers waited until their deadline.

The pool now counts the callers of each thread, and the cleanup stops
only threads without callers. This also removes the active flag, which
was written without a lock (data race). A thread in the pool map is
always running, because the pool stops a thread and removes it from the
map under the same lock.

Assisted-by: Claude:claude-opus-5-5
When a caller stops waiting (context canceled or deadline exceeded),
Execute returns the context error, but the request stays in the queue.
The thread then ran it anyway, and the requests behind it waited longer.

The thread now skips a request when its context is done.

Assisted-by: Claude:claude-opus-5-5
A user thread writes its own thread ID after it starts, but the logging
code reads it from other goroutines without a lock. This happens when
several requests of a new user arrive at the same time. The thread ID
is now an atomic value.

Assisted-by: Claude:claude-opus-5-5
The driver called these syscalls with the amd64 numbers (186, 122, 123)
on all architectures. On arm64 these numbers are msgget,
sched_setaffinity and sched_getaffinity, thus the user threads never
changed their fsuid and all operations ran as the process user. New()
only logs the failed privilege check and continues.

x/sys/unix uses the correct number for each architecture. On amd64 the
behaviour does not change.

Assisted-by: Claude:claude-opus-5-5
@rawe0
rawe0 force-pushed the cephmount-thread-pool-followups branch from 2382468 to aab811e Compare October 30, 2026 15:23
@rawe0
rawe0 marked this pull request as ready for review October 30, 2026 15:24
Upload copied the request body to the file on the user thread. The
speed of the client decided how long this took, and during that time
all other requests of the user waited. All external accounts and
public-link guests use one thread, thus one slow upload blocked all of
them.

The file is now opened on the user thread, which creates it with the
user as owner and does the permission check. The data is copied outside
the thread, because a write to an open file is not checked again.
Download already works like this.

The error from Close is now returned. CephFS can report write errors
only when it flushes the data at close, and before this change such an
upload reported success.

Assisted-by: Claude:claude-opus-5-5
@rawe0
rawe0 force-pushed the cephmount-thread-pool-followups branch from aab811e to c1ad762 Compare October 30, 2026 15:34

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant