<!--

Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
Don't worry if they're not all applicable; just try to include what you can :-)

If you need to include code snippets or logs, please put them in fenced code
blocks.  If they're super-long, please use the details tag like
<details><summary>super-long log</summary> lots of stuff </details>

Please delete these comment blocks before submitting the issue.

-->

<!--

IMPORTANT!!!

PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!

PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!

Please complete the next sections or the issue will be closed.
These questions are the first thing we need to know to understand the context.

-->


**What happened**:

<!-- (please include exact error messages if you can) -->
Smart Sensor TI crashes with a Runtime error. Here's the logs:
```
RuntimeError: dictionary changed size during iteration
  File "airflow/sentry.py", line 159, in wrapper
    return func(task_instance, *args, session=session, **kwargs)
  File "airflow/models/taskinstance.py", line 1112, in _run_raw_task
    self._prepare_and_execute_task_with_callbacks(context, task)
  File "airflow/models/taskinstance.py", line 1285, in _prepare_and_execute_task_with_callbacks
    result = self._execute_task(context, task_copy)
  File "airflow/models/taskinstance.py", line 1315, in _execute_task
    result = task_copy.execute(context=context)
  File "airflow/sensors/smart_sensor.py", line 736, in execute
    self.flush_cached_sensor_poke_results()
  File "airflow/sensors/smart_sensor.py", line 681, in flush_cached_sensor_poke_results
    for ti_key, sensor_exception in self.cached_sensor_exceptions.items():
```


**What you expected to happen**:

<!-- What do you think went wrong? -->
Smart sensor should always execute without any runtime error.

**How to reproduce it**:
I haven't been able to reproduce it consistently since it sometimes works and sometimes errors.

**Anything else we need to know**:
It's a really noisy error in Sentry. In just 4 days, 3.8k events were reported in Sentry.
<!--

How often does this problem occur? Once? Every time etc?

Any relevant logs to include? Put them here in side a detail tag:
<details><summary>x.log</summary> lots of stuff </details>

-->

airflow/sensors/smart_sensor.py
"""
        Fail task if accumulated exceptions exceeds retries.
        :param sensor_work: SensorWork
        """
        sensor_exception = self.cached_sensor_exceptions.get(sensor_work.cache_key)
        error = sensor_exception.exception_info
        sensor_work.log.exception("Handling poke exception: %s", error)
        if sensor_exception.fail_current_run:
            if sensor_exception.is_infra_failure:
                sensor_work.log.exception(
                    "Task %s failed by infra failure in smart sensor.", sensor_work.ti_key
                )
                
                
                
                
                
                cache_key = sensor_work.cache_key
                self.cached_dedup_works[cache_key].set_to_flush()
            else:
                sensor_work.log.exception("Task %s failed by exceptions.", sensor_work.ti_key)
            self._retry_or_fail_task(sensor_work, error)
        else:
            sensor_work.log.info("Exception detected, retrying without failing current run.")
            self._check_and_handle_ti_timeout(sensor_work)
    def _process_sensor_work_with_cached_state(self, sensor_work, state):