Skip to content

Commit e01e5cf

Browse files
committed
fix: eliminate race condition in buildDSLDependency() for @-namespaced DSL
Mutating the shared cached definition struct (arguments.definition.dsl) under concurrent load caused double-concatenation and mis-wiring when multiple threads resolved the same @-namespaced injection simultaneously (e.g. inject="myService@moduleName"). Instead of writing back to the shared struct, call getInstance() directly with the locally-computed concatenated name. The @-prefixed branch in getModelDSL() always resolves to a plain getInstance() call (no colons possible), so this is behaviourally identical but fully thread-safe. https://claude.ai/code/session_015kUgi5MyDwtH2FWf5u5DDN
1 parent bad36c5 commit e01e5cf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

system/ioc/Builder.cfc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,10 @@ component serializable="false" accessors="true" {
678678
// If no DSL's found, let's try to use the name as the empty namespace
679679
default: {
680680
if ( len( DSLNamespace ) && left( DSLNamespace, 1 ) == "@" ) {
681-
arguments.definition.dsl = arguments.definition.name & arguments.definition.dsl;
681+
refLocal.dependency = variables.injector.getInstance( arguments.definition.name & arguments.definition.dsl );
682+
} else {
683+
refLocal.dependency = getModelDSL( argumentCollection = arguments );
682684
}
683-
refLocal.dependency = getModelDSL( argumentCollection = arguments );
684685
}
685686
}
686687

0 commit comments

Comments
 (0)