-
Notifications
You must be signed in to change notification settings - Fork 85
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
incorrect pipeline status when restarted the server #130
Comments
…eue for execution #130 Signed-off-by: Thomas Druez <[email protected]>
…gic #130 Signed-off-by: Thomas Druez <[email protected]>
Signed-off-by: Thomas Druez <[email protected]>
…and False #130 Signed-off-by: Thomas Druez <[email protected]>
@AvishrantsSh I'd like to get your input on this one. Any ideas on how we could improve this? To reproduce:
The pipeline will show as "running" forever while not running anymore. That status display is based on the database state of the Pipeline run, it was marked as "started" at the start of the pipeline execution, but since the worker process was "killed", it never got the chance to be marked as "ended/failed". |
@tdruez, I've looked into this issue and I believe there are a few workarounds:
Personally, I feel that the second solution makes more sense as it is guaranteed that no celery job will be running at that time that might interfere with the cleansing. Besides, it is also simpler to implement than signals. |
I tried to implement the second solution and it seems to work perfectly. |
@AvishrantsSh thanks for your input. This approach works alright in local "runserver" mode. But in the full stack mode (redis + celery worker + webserver + ALWAYS_EAGER = False) the "When the server is started" would not work since each service is run separately. The celery worker could still be working on a task while you restart the webserver for example. |
@tdruez As you rightly said, the approach that I mentioned should work in "offline" mode. |
Yes, the celery workers access the database independently from the django app. Also, we can have multiple celery workers running, so doing the cleanup on starting a worker would not be good enough. |
@tdruez, can you provide me with instructions on how to test the full implementation. I tried doing it with a dockerized container of redis and using the command |
@AvishrantsSh there's 2 ways to run the full ScanCode.io stack: 1. Running each service individually (dev mode, Linux and macOS only)
2. Docker (production mode) |
@AvishrantsSh after looking deeper into this issue, the The celery inspect tool works at the workers level and knows only about the executing tasks and schedule ones (prefetched tasks). It does not provide an insight in the full queue of tasks. Those are waiting to be picked, by a worker, on the broker (redis) side. The queued tasks can be gather using the redis api:
I'm working on a solution that will combine those to recover all the tasks:
|
Hi, I can confirm that the version from today (September 6), still has problems when a scan is running and I just The status for the pipeline stays "running". When trying to "start_pipeline" I'm told that this pipeline is already running. What I like to have is that after restarting scancode.io :
At moment I can also not determine if such a dead running pipeline is working or not, so I can't delete it and try again. |
Signed-off-by: Thomas Druez <[email protected]>
Signed-off-by: Thomas Druez <[email protected]>
with default policy of fsync every second Signed-off-by: Thomas Druez <[email protected]>
Signed-off-by: Thomas Druez <[email protected]>
Synchronise the `self` Run instance with its related RQ Job Signed-off-by: Thomas Druez <[email protected]>
…eady #130 Signed-off-by: Thomas Druez <[email protected]>
Signed-off-by: Thomas Druez <[email protected]>
Signed-off-by: Thomas Druez <[email protected]>
Signed-off-by: Thomas Druez <[email protected]>
…C queue #130 Signed-off-by: Thomas Druez <[email protected]>
Signed-off-by: Thomas Druez <[email protected]>
Signed-off-by: Thomas Druez <[email protected]>
…357) * Flag stale runs on app ready in SYNC mode #130 Signed-off-by: Thomas Druez <[email protected]> * Enable redis data persistence using AOF #130 with default policy of fsync every second Signed-off-by: Thomas Druez <[email protected]> * Make sure the job is found before calling delete in Run.delete_task #130 Signed-off-by: Thomas Druez <[email protected]> * Add a sync_with_job method on the run model #130 Synchronise the `self` Run instance with its related RQ Job Signed-off-by: Thomas Druez <[email protected]> * Synchronizes QUEUED and RUNNING Runs with their related Jobs on app ready #130 Signed-off-by: Thomas Druez <[email protected]> * Add unit test for sync_with_job method #130 Signed-off-by: Thomas Druez <[email protected]> * Move the synchronization process in a custom Worker class #130 Signed-off-by: Thomas Druez <[email protected]> * Simplify the synchronization logic #130 Signed-off-by: Thomas Druez <[email protected]> * Reduce the "cleaning lock" ttl from 899 seconds to 60 seconds in ASYNC queue #130 Signed-off-by: Thomas Druez <[email protected]> * Add unit tests for better coverage #130 Signed-off-by: Thomas Druez <[email protected]> * Add CHANGELOG entry #130 Signed-off-by: Thomas Druez <[email protected]>
Extract from the v30.1.0 release notes https:/nexB/scancode.io/releases/tag/v30.1.0:
|
I've created couple projects and launch a docker pipeline on each of them, but then the server is dead. Therefore, I restarted the server, and when I open the project page again, the "status" next to the pipelines is still showing "Running" which is incorrect.
The text was updated successfully, but these errors were encountered: