Skip to content

Commit 558565c

Browse files
committed
Added the awaitInitialization() call as suggested in #71.
1 parent 1f9e957 commit 558565c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

aws-serverless-java-container-spark/src/main/java/com/amazonaws/serverless/proxy/spark/SparkLambdaContainerHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ protected void handleRequest(AwsProxyHttpServletRequest httpServletRequest, AwsH
170170
// manually add the spark filter to the chain. This should the last one and match all uris
171171
FilterRegistration.Dynamic sparkRegistration = getServletContext().addFilter("SparkFilter", embeddedServer.getSparkFilter());
172172
sparkRegistration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/*");
173+
174+
// adding this call to make sure that the framework is fully initialized. This should address a race
175+
// condition and solve GitHub issue #71.
176+
Spark.awaitInitialization();
173177
}
174178

175179
doFilter(httpServletRequest, httpServletResponse, null);

0 commit comments

Comments
 (0)