I provide some http-API, the average load is about zero, but I can get several requests in a second.
Structure is:
Servlet with only this annotation:
@WebServlet(urlPatterns = "/001")it injects
Stateless EJB(with@EJBannotation)Stateless EJB injects Singleton EJB and runs some of it's methods. Singleton EJB holds sort of a cache (dataset is only 250MB, but when it is loaded in apache's DualHashBidiMap it takes couple of gigabytes, so I've changed Wildfly's maximum heap size to 4GB)
The dataset is static, it is populated on startup in a method
@PostConstruct
@Lock(LockType.WRITE)
void init() {}
all other methods are marked
@Lock(LockType.READ)
But randomly (once a day, sometimes once a week) I get
2017-10-04 13:50:04,793 ERROR [org.jboss.as.ejb3.invocation] (default task-112) WFLYEJB0034: EJB Invocation failed on component NameRewriter for method public java.lang.Integer ejbs.NameRewriter.parse((java.lang.String): javax.ejb.ConcurrentAccessTimeoutException: WFLYEJB0241: EJB 3.1 PFD2 4.8.5.5.1 concurrent access timeout on NameRewriter - could not obtain lock within 30000MILLISECONDS
Methods should be allowed to work concurrently, aren't whey? The most ridiculous thing - when timeouts start to appear, this can continue for several hours! All requests are not served.
My Singleton only fire BidiMap's containsKey , containsValue and get and that's all.
Configuration is:
- OS: Centos7.3
- Openjre8 141
- Wildfly 10.1.
I cannot catch the right moment to make a stack dump. Please suggest something to narrow the problem!
P.S. Average processing time for whole request to Stateless EJB is about 10-100 milliseconds. So, I do not understand how it can do something for 30 seconds (even if it was LockType.WRITE). And also I do not have ORM, just MongoDB, it doesn't look as offender.