-
Notifications
You must be signed in to change notification settings - Fork 62
Unstable max ar workers #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
Conversation
5da4ee0
to
70603f3
Compare
caab098
to
363886f
Compare
363886f
to
85be435
Compare
Introduce a new `archiveWorkers` channel to limit the number of concurrent archive operations. When the limit is reached, new requests will receive a 429 Too Many Requests response. This prevents resource exhaustion and improves system stability. The maximum number of workers can be configured via the `--max-archive-workers` CLI option.
…hive-worker-limit
5e464f5
to
4320eac
Compare
4320eac
to
63dedd2
Compare
} else { | ||
data.Status = http.StatusTooManyRequests | ||
} | ||
atomic.AddUint32(h.archivingWorkers, ^uint32(0)) // archiveWorkers -= 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can ^uint32(0)
cause uint underflow? (0 - 1 -> 4294967295)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case, this would never happened since it always added by 1 first.
@OlegChuev as this project is claimed and designed as stateless(https://github.com/mjpclab/go-http-file-server/blob/main/README.md#tech-features), stateful variable(here |
No description provided.