3 consecutive calls to launch an audit leads to crash
Summary
Auditing the same site 3 times crashes Asqatasun server
Steps to reproduce
Context: workstation, AsqatasunServer ran in debug mode from IntelliJ
Run:
for i in 1 2 3; do
curl -X 'POST' \
'http://admin%40asqatasun.org:myAsqaPassword@localhost:8080/api/v0/audit/page/run' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"urls": [
"https://asqatasun.org"
],
"referential": "RGAA_4_0",
"level": "AA",
"contractId": 1,
"tags": [
"2023-01-22_debug"
]
}';
done
What is the current bug behavior?
- No more audit can be run. But the API does accept requests, and moreover answers and gives an id to the new audit (but it is never launched).
- Querying the status of the 3 audits gives: two audits are in state
ERROR
and another one is in statePROCESSING
. The audit being inPROCESSING
state is not always the same (say the second one, or the third one, etc) - Two Firefox windows are still open on the desktop
What is the expected correct behavior?
- All three audits should be
COMPLETED
- All Firefox windows should be closed
- Further audits should be processed
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
Exception in thread "Thread-39" java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1469)
at java.util.HashMap$KeyIterator.next(HashMap.java:1493)
at org.asqatasun.service.AuditServiceImpl.auditCrashed(AuditServiceImpl.java:164)
at org.asqatasun.service.AuditServiceThreadQueueImpl.fireAuditCrashed(AuditServiceThreadQueueImpl.java:219)
at org.asqatasun.service.AuditServiceThreadQueueImpl.auditCrashed(AuditServiceThreadQueueImpl.java:183)
at org.asqatasun.service.AuditServiceThreadImpl.fireAuditException(AuditServiceThreadImpl.java:149)
at org.asqatasun.service.AuditServiceThreadImpl.run(AuditServiceThreadImpl.java:101)
at java.lang.Thread.run(Thread.java:750)
Exception in thread "Thread-38" java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1469)
at java.util.HashMap$KeyIterator.next(HashMap.java:1493)
at org.asqatasun.service.AuditServiceImpl.auditCrashed(AuditServiceImpl.java:164)
at org.asqatasun.service.AuditServiceThreadQueueImpl.fireAuditCrashed(AuditServiceThreadQueueImpl.java:219)
at org.asqatasun.service.AuditServiceThreadQueueImpl.auditCrashed(AuditServiceThreadQueueImpl.java:183)
at org.asqatasun.service.AuditServiceThreadImpl.fireAuditException(AuditServiceThreadImpl.java:149)
at org.asqatasun.service.AuditServiceThreadImpl.run(AuditServiceThreadImpl.java:101)
at java.lang.Thread.run(Thread.java:750)
/cc @jkowalczyk
Edited by Matthieu FAURE