Skip to content

TerminalUI may get race condition for display update #1039

Closed
@jvalkeal

Description

@jvalkeal

Running catalog app in vscode on windows may throw:

start catalog:

java.util.ConcurrentModificationException: null
        at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1221) ~[na:na]
        at org.jline.utils.Display.cost(Display.java:367) ~[jline-terminal-3.25.1.jar:na]
        at org.jline.utils.Display.perform(Display.java:353) ~[jline-terminal-3.25.1.jar:na]
        at org.jline.utils.Display.moveVisualCursorTo(Display.java:439) ~[jline-terminal-3.25.1.jar:na]
        at org.jline.utils.Display.update(Display.java:263) ~[jline-terminal-3.25.1.jar:na]
        at org.jline.utils.Display.update(Display.java:107) ~[jline-terminal-3.25.1.jar:na]
        at org.springframework.shell.component.view.TerminalUI.display(TerminalUI.java:293) ~[main/:na]
        at org.springframework.shell.component.view.TerminalUI.loop(TerminalUI.java:394) ~[main/:na]
        at org.springframework.shell.component.view.TerminalUI.run(TerminalUI.java:121) ~[main/:na]
        at org.springframework.shell.samples.catalog.Catalog.run(Catalog.java:150) ~[main/:na]
        at org.springframework.shell.samples.catalog.CatalogCommand.catalog(CatalogCommand.java:47) ~[main/:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
        at org.springframework.shell.command.invocation.InvocableShellMethod.doInvoke(InvocableShellMethod.java:306) ~[main/:na]
        at org.springframework.shell.command.invocation.InvocableShellMethod.invoke(InvocableShellMethod.java:232) ~[main/:na]
        at org.springframework.shell.command.CommandExecution$DefaultCommandExecution.evaluate(CommandExecution.java:230) ~[main/:na]
        at org.springframework.shell.Shell.evaluate(Shell.java:248) ~[main/:na]
        at org.springframework.shell.Shell.run(Shell.java:159) ~[main/:na]

While not seen on linux this may be specific for windows. Screen update may from events like screen size change. We probably need to synchronise update and see if it makes a difference.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions