austinmiller / augustmc

Scala Mud Client with JVM-based Scripting
Apache License 2.0
10 stars 2 forks source link

Darcula's iconloader can hang the UI thread #3

Open austinmiller opened 7 years ago

austinmiller commented 7 years ago

The iconloader will sometimes try to make a socket connection to retrieve an icon. If the socket connection times out (say if you have spotty internet) this can hang the UI thread until it times out. It's also probably a UI performance issue under other circumstances.

Here is the jstack thread dump:

   "AWT-EventQueue-0" #15 prio=6 os_prio=31 tid=0x00007fe79104b000 nid=0xf8fb runnable [0x000070000be7c000]
       java.lang.Thread.State: RUNNABLE
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    - locked <0x00000007974b83d8> (a java.net.PlainSocketImpl)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:957)
    at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:917)
    at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1012)
    at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:998)
    at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294)
    - locked <0x00000007974b84e0> (a sun.net.www.protocol.ftp.FtpURLConnection)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:393)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:214)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:71)
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:84)
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
    at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
    at com.bulenkov.iconloader.util.ImageLoader$ImageDesc.load(ImageLoader.java:102)
    at com.bulenkov.iconloader.util.ImageLoader$ImageDescList.load(ImageLoader.java:129)
    at com.bulenkov.iconloader.util.ImageLoader.loadFromUrl(ImageLoader.java:265)
    at com.bulenkov.iconloader.IconLoader$CachedImageIcon.getRealIcon(IconLoader.java:393)
    - locked <0x0000000741bd31c0> (a com.bulenkov.iconloader.IconLoader$CachedImageIcon)
    at com.bulenkov.iconloader.IconLoader$CachedImageIcon.getIconHeight(IconLoader.java:425)
    at com.bulenkov.darcula.ui.DarculaSplitPaneDivider.paint(DarculaSplitPaneDivider.java:51)
austinmiller commented 7 years ago

Likely won't schedule for 2017.1 because it is only an annoyance when the client does not have internet, which is unlikely in a mud client.

austinmiller commented 7 years ago

I hit long UI pauses that were too fast for me to take a jstack. 3-4 times. It's annoying. Should probably fix this.