v.21.1Improvements

Local session events in ClickHouse dictionaries no longer send to session log, resolving deadlock issue and fixing flaky test

The local session inside a ClickHouse dictionary source won't send its events to the session log anymore. This fixes a possible deadlock (tsan alert) on shutdown. Also this PR fixes flaky test_dictionaries_dependency_xml/. #31013 (Vitaly Baranov).
Fix deadlock and flaky test in dictionary source session logging. The local session inside a ClickHouse dictionary source no longer sends events to the session log, preventing a potential deadlock during shutdown.

Why it matters

This change addresses a race condition causing a deadlock (reported via a tsan alert) during ClickHouse shutdown when the dictionary source's local session tries to send events to the session log. It also resolves instability in the test_dictionaries_dependency_xml/ test, improving reliability of ClickHouse's dictionary subsystem.

How to use it

No user intervention is required as this is an internal fix. Users will benefit automatically after upgrading to the version including this patch.