Using a 2.0.0 beta 2 build...

![Untitled](https://user-images.githubusercontent.com/4283/99546252-3ebe1a80-2984-11eb-9681-8d6e718b22c5.gif)

Log from webserver:

```
[2020-11-18 14:58:52,712] {interface.py:713} ERROR - Delete record error: Dependency rule tried to blank-out primary key column 'job.id' on instance '<SchedulerJob at 0x7fc68ba7f990>'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py", line 698, in delete
    self.session.commit()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/scoping.py", line 163, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1042, in commit
    self.transaction.commit()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 504, in commit
    self._prepare_impl()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 483, in _prepare_impl
    self.session.flush()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2536, in flush
    self._flush(objects)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2678, in _flush
    transaction.rollback(_capture_exception=True)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    with_traceback=exc_tb,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2638, in _flush
    flush_context.execute()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
    rec.execute(self)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/unitofwork.py", line 538, in execute
    self.dependency_processor.process_deletes(uow, states)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/dependency.py", line 547, in process_deletes
    state, child, None, True, uowcommit, False
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/dependency.py", line 604, in _synchronize
    sync.clear(dest, self.mapper, self.prop.synchronize_pairs)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/sync.py", line 88, in clear
    "column '%s' on instance '%s'" % (r, orm_util.state_str(dest))
AssertionError: Dependency rule tried to blank-out primary key column 'job.id' on instance '<SchedulerJob at 0x7fc68ba7f990>'
172.19.0.1 - - [18/Nov/2020:14:58:52 +0000] "POST /dagrun/delete/147 HTTP/1.1" 302 415 "http://localhost:8080/dagrun/list/?_flt_3_dag_id=airflow_community_data_refresh&_flt_3_state=success" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.193 Safari/537.36"
```
tests/models/test_dagrun.py
ti_op2.set_state(state=State.FAILED, session=session)
        ti_op3.set_state(state=State.SUCCESS, session=session)
        ti_op4.set_state(state=State.SUCCESS, session=session)
        dr.update_state()
        self.assertEqual(State.SUCCESS, dr.state)
    def test_dagrun_deadlock(self):
        session = settings.Session()
        dag = DAG('text_dagrun_deadlock', start_date=DEFAULT_DATE, default_args={'owner': 'owner1'})
        with dag:
            op1 = DummyOperator(task_id='A')
            op2 = DummyOperator(task_id='B')
            op2.trigger_rule = TriggerRule.ONE_FAILED
            op2.set_upstream(op1)
        dag.clear()
        now = timezone.utcnow()
        dr = dag.create_dagrun(
            run_id='test_dagrun_deadlock', state=State.RUNNING, execution_date=now, start_date=now
        )
        ti_op1 = dr.get_task_instance(task_id=op1.task_id)
        ti_op1.set_state(state=State.SUCCESS, session=session)
        ti_op2 = dr.get_task_instance(task_id=op2.task_id)
        ti_op2.set_state(state=State.NONE, session=session)
        dr.update_state()
        self.assertEqual(dr.state, State.RUNNING)
        ti_op2.set_state(state=State.NONE, session=session)
        op2.trigger_rule = 'invalid'
        dr.update_state()
        self.assertEqual(dr.state, State.FAILED)
    def test_dagrun_no_deadlock_with_shutdown(self):