]
Matěj Novotný commented on WFWIP-309:
-------------------------------------
[~lthon] you shouldn't need anything, it's a shared [always
]
context which should be visible from all threads.
Is it possible that you are getting this error because something else blew up previously
and Weld was shutdown? That's probably the only case where I can think of getting this
exception...
MP Fault Tolerance - WELD-001303: No active contexts for scope type
javax.enterprise.context.ApplicationScoped
--------------------------------------------------------------------------------------------------------------
Key: WFWIP-309
URL:
https://issues.redhat.com/browse/WFWIP-309
Project: WildFly WIP
Issue Type: Bug
Components: MP Fault Tolerance
Reporter: Miroslav Novak
Assignee: Radoslav Husar
Priority: Blocker
There is unexpected error log in following test scenario:
- Deploy MP FT service with:
{noformat}
@Asynchronous
@Bulkhead(value = 15, waitingTaskQueue = 15)
@Timeout(value = 1000)
@Fallback(fallbackMethod = "processFallback")
public CompletionStage<MyConnection> bulkheadTimeout(boolean fail) throws
InterruptedException {
if (fail) {
Thread.sleep(2000);
}
return CompletableFuture.completedFuture(new MyConnection() {
@Override
public String getData() {
return "Hello from @Bulkhead @Timeout method";
}
});
}
private CompletionStage<MyConnection> processFallback(boolean fail) {
return CompletableFuture.completedFuture(new MyConnection() {
@Override
public String getData() {
return "Fallback Hello";
}
});
}
{noformat}
- Send 10+ parallel requests with fail == true
Expected result:
All requests should go to fallback.
Actual Result:
This test is currently hitting issue WFWIP-308 however additionally there is error in
server log:
{code}
16:55:41,374 ERROR [stderr] (pool-22-thread-2) Exception in thread
"pool-22-thread-4" Exception in thread "pool-22-thread-2"
org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for
scope type javax.enterprise.context.ApplicationScoped
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at
org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647)
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at
org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at
org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:123)
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at
org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at
org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at
org.eclipse.microprofile.metrics.MetricRegistry$Proxy$_$$_WeldClientProxy.getHistograms(Unknown
Source)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at
io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramOf(MetricsCollectorFactory.java:105)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at
io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramUpdate(MetricsCollectorFactory.java:86)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at
io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.bulkheadQueueLeft(MetricsCollectorFactory.java:125)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at
io.smallrye.faulttolerance.core.bulkhead.CompletionStageBulkhead$CompletionStageBulkheadTask.run(CompletionStageBulkhead.java:78)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at java.lang.Thread.run(Thread.java:748)
{code}