sentinel-dashboard TreeMap ConcurrentModificationException #201
Labels
area/dashboard
Issues or PRs about Sentinel Dashboard
kind/bug
Category issues or prs related to bug.
Milestone
Issue Description
When I use the dashboard, 'MetricFetcher' throws a ConcurrentModificationException and requests the home page,
Jackson
also throws the same exception.Describe what happened (or what feature you want)
Here is the exception stack traces:
and
Describe what you expected to happen
AppInfo
usessynchronized
for thegetMachines
andaddMachine
methods, but calls thegetmachines
method to get the sameTreeSet
, so there is no guarantee thatSet<MachineInfo> machines = new TreeSet<MachineInfo >();
is modified by multiple threads, so it is very likely that aConcurrentModificationException
exception will be thrown.However, I did not find that the
Set<MachineInfo>
was modified by calling thegetmachines
method.Here is the code for
AppInfo
:How to reproduce it (as minimally and precisely as possible)
getMachines
method, create a newTreeSet
to avoid concurrency issues.The text was updated successfully, but these errors were encountered: