') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Revert "Remove global variables in airflow.settings" by ashb · Pull Request #65718 · apache/airflow · GitHub
Skip to content

Revert "Remove global variables in airflow.settings" - #65718

Merged
ashb merged 1 commit into
mainfrom
revert-61917-bugfix/remove-global-from-settings
Apr 23, 2026
Merged

Revert "Remove global variables in airflow.settings"#65718
ashb merged 1 commit into
mainfrom
revert-61917-bugfix/remove-global-from-settings

Conversation

@ashb

@ashbashb commented Apr 23, 2026

Copy link
Copy Markdown
Member

Reverts #61917 - it broke all task execution.

 filename=/usr/local/lib/python3.13/site-packages/airflow/sdk/execution_time/supervisor.py lineno=575
--- Supervised process Last chance exception handler ---
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/airflow/sdk/execution_time/supervisor.py", line 420, in _fork_main
block_orm_access()
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/airflow/sdk/execution_time/supervisor.py", line 330, in block_orm_access
settings.block_orm_access()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/airflow/sdk/execution_time/supervisor.py", line 326, in __getattr__
raise AttributeError(f"module {settings.__name__!r} has no attribute {name!r}")
AttributeError: module 'airflow.settings' has no attribute 'block_orm_access'

@ashb
ashb merged commit 27d07cb into mainApr 23, 2026
36 checks passed
@ashb
ashb deleted the revert-61917-bugfix/remove-global-from-settings branch April 23, 2026 13:09
@ashb

ashb commented Apr 23, 2026

Copy link
Copy Markdown
MemberAuthor

Confirmed, reverting this and tasks are running again.

@jscheffl

Copy link
Copy Markdown
Contributor

Hi @ashb / @kaxil I tried to re-produce the error based on the commit and can not see how you ran into it. Can you share how to reproduce? In my tests with Python 3.12 and 3.13, LocalExecutor, Celery and Edge it was working through all my positive and negative tests. Unable to make the same error.

@ashb

ashb commented Apr 27, 2026

Copy link
Copy Markdown
MemberAuthor

@jscheffl Hmmmm, I'm not quite sure. All I know is that I rebuild and restarted everything two or three times, and this was the only thing that fixed it in my env.

@Miretpl

Copy link
Copy Markdown
Contributor

Looking at the logic (in the reverted PR), errors should happen for every flow like:

  1. from airflow import settings -> places airflow.settings in sys.modules
  2. invoke of airflow.sdk.execution_time.supervisor.block_orm_access function

I didn't check the general flow of imports, which would help write a test case for it and a full reproduction tho.

The solution would be to move (looking at the content of reverted PR) the:

settings.block_orm_access()

over

settings.__getattr__=__getattr__

as it basically blocks any callable usage from the settings module, which was not needed before, as we had:

settings.SQL_ALCHEMY_CONN=connsettings.SQL_ALCHEMY_CONN_ASYNC=conn

It wasn't needed, because SQL_ALCHEMY_CONN and SQL_ALCHEMY_CONN_ASYNC were found by __getattributes__, so __getattr__ was never invoked for them (a difference between Python attribute types).

Hope that helps!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@ashb@jscheffl@Miretpl@kaxil