https://dagster.io/ logo
c

Cris

06/26/2020, 12:55 AM
Hi! im running with a bit of an issue and some jobs that usually take minutes are taking hours. and are piling up due to the scheduler. Is there a way to stop executions that started with cron?
a

alex

06/26/2020, 2:27 PM
we are working on supporting termination from dagit, from you you’ll have to send a keyboard in interrupt to the process (or kill it for less graceful termination)
c

Cris

06/26/2020, 2:29 PM
Which process should I kill so to make it a little bit as clean as possible? I was using the multiprocessor executor. We killed all the processes that had dagster in it. Also, there were some processes that did a tail on compute logs, we had to remove those manually too.
a

alex

06/26/2020, 2:31 PM
if you send a
sigint
to the process coordinating the run the multiprocess executor will forward the interrupt and everything should wind down and shut down correctly
if you start using
sigkill
or
sigterm
- the unwind code wont run and you’ll have to chase the orphan processes like you mentioned
c

Cris

06/26/2020, 2:32 PM
I see. How can I identify the coordinator processes?
a

alex

06/26/2020, 2:34 PM
I believe the engine events in the event log print process id - but not positive
c

Cris

06/26/2020, 2:35 PM
ah true, thanks
a

alex

06/26/2020, 2:35 PM
they will be invoking
dagster api execute_run
c

Cris

06/26/2020, 2:35 PM
We still had like 40 to clean haha
😢 1
a

alex

06/26/2020, 2:35 PM
as opposed to the multiprocess executor which is using the python multiprocessing library
c

Cris

06/26/2020, 2:37 PM
Do you have an active issue for the functionality of terminating a pipeline manually? I would be very interested in following its development.
c

Cris

06/26/2020, 4:29 PM
Thanks, is this the reason why all the runs still appear running in dagit? could you suggest a way to fix the state?
a

alex

06/26/2020, 4:34 PM
They still appear running in dagit since nothing updated the run DB to put them in to failed state. If they shut down gracefully theyll do that. You can either delete the runs to remove them or update them manually in a python script or shell doing something like
Copy code
instance = DagsterIntance.get()
run = instance.get_run_by_id(bad_state_run_id)
instance.report_run_failed(run)
c

Cris

06/26/2020, 4:35 PM
Thanks, how can i get all the ids that appear running?
Also, how can I initialize this instance object? this will be to fix the runs in production, we start dagit using a regular dagit command with a workspace file
a

alex

06/26/2020, 5:11 PM
DagsterInstance.get()
will use the
dagster.yaml
in
$DAGSTER_HOME
, as long as you are talking to right
run_storage
you can do what you need You should be able to see the run ids in
dagit
,
c

Cris

06/26/2020, 5:12 PM
I see, this is interesting to implement certain maintanance scripts. Thanks!
Haha and true, I saw them but they were a lot. For now I ended spending a few minutes deleting them. Next time ill try the script
a

alex

06/26/2020, 5:14 PM
ya if you end up with a script you can do
all_runs = instance.get_runs()
and then just poke at the
PipelineRun
s to decide what to do