Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: CME with fetch API #4179

Closed
kwvanderlinde opened this issue Jun 28, 2023 · 3 comments · Fixed by #4197
Closed

[Bug]: CME with fetch API #4179

kwvanderlinde opened this issue Jun 28, 2023 · 3 comments · Fixed by #4197
Assignees
Labels

Comments

@kwvanderlinde
Copy link
Collaborator

Describe the Bug

Rarely, using the fetch API from an HTML5 context will result in a ConcurrentModificationException, though the only indication of it is a single line chat message that says 135: java.util.ConcurrentModificationException.

To Reproduce

  1. Open this campaign
    • It creates a frame5 that repeatedly makes fetch() calls.
  2. Wait
  3. Eventually see some 135: java.util.ConcurrentModificationException in chat.

Expected Behaviour

The CME should be avoided or handled appropriately, and not be presented to the user via chat.

Screenshots

No response

MapTool Info

MapTool 1.13.1

Desktop

Linux Mint 21.1

Additional Context

I managed to set a breakpoint for the CME and it is being thrown in MTXMLHttpRequest._getResponseHeaders(), specifically the responseHeaders.forEach() call is being complained about in the JavaFX Application Thread.

After some quick digging, I believe we're running into a race between MTXMLHttpRequest and RequestHandler which both modify the response headers but on different threads. We're also ignoring the result of thenApply(), which allows the two thenApply() call to be sequenced in the reverse order that they were called.

@cwisniew
Copy link
Member

@kwvanderlinde do you want to try this one in your setup with the latest from develop? I ran it to see if I could quickly find the error but it has yet to fail (30+ minutes)

@kwvanderlinde
Copy link
Collaborator Author

I have reproduced it on latest develop as well. It's very inconsistent and sometimes it happens lots, other times I can go an hour without seeing it.

@kwvanderlinde
Copy link
Collaborator Author

Just found a similar intermittent issue about statusText. Didn't get a copy of the error, but I'll include a small change to handle an edge case there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants