Add per-token job limits and asynchronous status commands #12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
The queued remote client currently allows a token to submit jobs until the global queue capacity is reached. There is no per-token maximum for active jobs, so one client can consume the shared queue and reduce availability for other clients.
The client also always waits for a submitted job to reach a terminal result. There is no asynchronous submission mode and no command to inspect a queued job status without waiting for its result.
Confirmed implementation points:
svr/job_queue.py::JobQueueenforces only the globalcapacity.svr/svc_ccwget.py::submit_jobauthenticates a token and submits a job.client/ccwget-remote.py::submitpolls until completion.Proposed approach
-asyncoption that submits the job and returns its job identifier immediately.-status JOB_IDoption that displays queue state, position, wait time, table progress, and terminal errors/results metadata without implicitly downloading an object.Scope
svr/job_queue.pyto count active jobs by token identity.svr/svc_ccwget.pyto load per-token limits from YAML and enforce them atomically during submission.config_svr.yaml.samplewith the default and override structure.client/ccwget-local.pyparser help so the shared command contract is visible.client/ccwget-remote.pywith asynchronous submission and status rendering.Acceptance criteria
./ccwget-remote.py -async URLreturns successfully without waiting and prints a usable job identifier../ccwget-remote.py -status JOB_IDreports WAITING, RUNNING, DONE, and ERROR states with queue position and progress.-async -statusfail with a clear client-side message.Dependencies
Additional requirements for issue #12:
Server operator commands
Extend the server binary with:
./svr/svc_ccwget.py --status: show configured token key identities and active job counts, without exposing plaintext tokens../svr/svc_ccwget.py --flush KEY: remove queued jobs for one key and cancel its running job if possible.--flush-allonly if implementation requires it; never make a broad flush implicit.Client command
Add a client flush command using the authenticated API:
./ccwget-remote.py --flushflushes all jobs owned by the current token, including the running job.Acceptance additions:
Fixed in commit
7760f6c. --result JOB_ID now reports WAITING, RUNNING, or CANCEL_REQUESTED immediately without polling, fetching results, or deleting active jobs. Terminal result behavior remains unchanged. Tests and documentation updated.