lingochamp / lingochamp/FileDownloader

java.util.ConcurrentModificationException

Open
#1,335 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
11.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1453)
at java.util.HashMap$EntryIterator.next(HashMap.java:1487)
at java.util.HashMap$EntryIterator.next(HashMap.java:1485)
at cq.llsfdl.cc.a(ConnectTask.java:130)
at cq.llsfdl.cc.a(ConnectTask.java:86)
at cq.llsfdl.cf.g(DownloadLaunchRunnable.java:393)
at cq.llsfdl.cf.run(DownloadLaunchRunnable.java:255)
at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)

![image](https://user-images.githubusercontent.com/9621271/81252917-ccc25b80-9059-11ea-9455-7982b9870a71.png)

崩溃出现在130行,迭代entries时出了问题。
应该是多个线程对 FileDownloadHeader#mHeaderMap进行了操作导致的。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at ConnectTask.java:130, where iteration over the entries fails, then trace the calls from DownloadLaunchRunnable.java and inspect FileDownloadHeader#mHeaderMap. Determine how concurrent access can occur and verify that concurrent downloads no longer produce ConcurrentModificationException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.