Closed RonGatenio closed 7 years ago
Widgets Bug!!
Take a look here, and pay attention to the line graph:
Note that the second error is from the failure detector... because of JavaFX's Alert.showAndWait
... this is not the main error, only a by-product
I think I know how to solve this... @EliaTraore may I help you?
Go ahead! 😄 Whats the solution?
Removed the 1st data point if we have more than maxDataSize
data points overall and moved the number of data points to a field so it won't be influenced by their removal.
Not trying to be the party pooper, but I was trying the stove app (what @RonGatenio showed in the GIF above) and it doesn't work so well... Is it an error on my end?
weird... worked for me... => heisenbug 😭
Does this help?
+ @inbalzukerman you're always the party pooper :stuck_out_tongue_winking_eye:
Now I get this exception (not always, sometimes I get the original exception):
java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:386)
at java.util.AbstractList$Itr.next(AbstractList.java:355)
at javafx.scene.chart.LineChart.updateAxisRange(LineChart.java:203)
at javafx.scene.chart.XYChart.layoutChartChildren(XYChart.java:660)
at javafx.scene.chart.Chart$1.layoutChildren(Chart.java:94)
at javafx.scene.Parent.layout(Parent.java:1087)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Scene.doLayoutPass(Scene.java:552)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2397)
at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:354)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:381)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
Plus, I noticed two more things:
@EliaTraore - I totally knew you're going to say something like that 😢
Anyway: The problems I encountered are:
I think the java.util.ConcurrentModificationException
is a result of the underlaying list not being updated in a blocking manner, which means that even thought the update itself is done one at a time, the concurrency still is problematic in the back.
If that is the case, the only solution will be to add Thread.sleep(x)
at the end of the update to make sure the information updates correctly, which might slow the GUI too much (and still not always work).
So if it is, I think it's fair write it off as a known bug and leave it (unless any of you want to take it up on yourself to fix hansolo's code :wink: )
If the synchronized
was supposed to solve the bug, apparently it doesn't so we can remove it and stay with one type of exceptions instead of two 😅
We concluded the the accumulation of data in the discussed widget is not threa-safe, causing mentioned bug. We decided to try and implement a thread safe version or find an alternative widget during Guinea-pig Milestone (#214), and if not - decide between writing it off as a known bug or removing it altogether. In any case, this issue can be closed.
also, solved ^ by Javafx's producer-consumer
We think that after the graph widgets absorbs a lot of data, it crashes!
I know the error doesn't explain anything, but that is all we got