Skip to content

Commit

Permalink
Synchronize calls to ComponentResolver createComponent (TORQUE-656)
Browse files Browse the repository at this point in the history
Without this synchronize multiple threads were attempting to
initialize components (specifically RackApplicationComponent) in a
single runtime thus leading to errors such as "undefined method
`to_app' for #<Rack::Builder:0x21aa4aaf>" and "uninitialized constant
Rack" when multiple requests come in to a previously unitialized Rack
runtime.
  • Loading branch information
bbrowning committed Jan 9, 2012
1 parent f20b8af commit 0cb4118
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -62,7 +62,7 @@ public RubyComponent resolve(final Ruby runtime) throws Exception {
return wrapComponent( rubyComponent );
}

protected IRubyObject createComponent(final Ruby runtime) throws Exception {
protected synchronized IRubyObject createComponent(final Ruby runtime) throws Exception {
prepareInjections(runtime);
IRubyObject rubyComponent = this.componentInstantiator.newInstance( runtime, this.initializeParams );
return rubyComponent;
Expand Down

0 comments on commit 0cb4118

Please sign in to comment.