You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scripts from different workspaces should have same results regardless if they are executed sequential or in parallel.
Actual
While working on PR for parallel branch building in structurizr-site-generatr there is issue that when building multiple workspaces in parallel Ruby scripting context is damaged and there is stack trace error:
javax.script.ScriptException: Error during evaluation of Ruby in /Users/kamil/Projects/Archive/structurizr-site-generatr/build/model-clone/2/docs/example/views.rb at line 9: (NoMethodError) undefined method `split' for ["tag1", "tag2", "tag3"]:Array
at org.jruby.embed.jsr223.JRubyEngine.wrapRaiseException(JRubyEngine.java:277)
at org.jruby.embed.jsr223.JRubyEngine.doEval(JRubyEngine.java:102)
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:126)
at com.structurizr.dsl.ScriptDslContext.run(ScriptDslContext.java:70)
at com.structurizr.dsl.ExternalScriptDslContext.end(ExternalScriptDslContext.java:23)
at com.structurizr.dsl.StructurizrDslParser.endContext(StructurizrDslParser.java:1167)
at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:242)
at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:140)
at nl.avisi.structurizr.site.generatr.CreateStructurizrWorkspaceKt.createStructurizrWorkspace(CreateStructurizrWorkspace.kt:10)
at nl.avisi.structurizr.site.generatr.GenerateSiteCommand.generateSiteForModelInGitRepository$lambda$4(GenerateSiteCommand.kt:130)
at nl.avisi.structurizr.site.generatr.GenerateSiteCommand.generateSiteForModelInGitRepository$lambda$5(GenerateSiteCommand.kt:117)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:667)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:765)
at nl.avisi.structurizr.site.generatr.GenerateSiteCommand.generateSiteForModelInGitRepository(GenerateSiteCommand.kt:117)
at nl.avisi.structurizr.site.generatr.GenerateSiteCommand.execute(GenerateSiteCommand.kt:77)
at kotlinx.cli.ArgParser.parse(ArgParser.kt:657)
at kotlinx.cli.ArgParser.parse(ArgParser.kt:530)
at nl.avisi.structurizr.site.generatr.AppKt.main(App.kt:13)
Caused by: org.jruby.exceptions.NoMethodError: (NoMethodError) undefined method `split' for ["tag1", "tag2", "tag3"]:Array
at RUBY.<main>(/Users/kamil/Projects/Archive/structurizr-site-generatr/build/model-clone/2/docs/example/views.rb:9)
Exception in thread "main" com.structurizr.dsl.StructurizrDslParserException: Error running script at views.rb, caused by javax.script.ScriptException: Error during evaluation of Ruby in /Users/kamil/Projects/Archive/structurizr-site-generatr/build/model-clone/2/docs/example/views.rb at line 9: (NoMethodError) undefined method `split' for ["tag1", "tag2", "tag3"]:Array at line 199 of /Users/kamil/Projects/Archive/structurizr-site-generatr/build/model-clone/2/docs/example/workspace.dsl: }
at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:1065)
at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:140)
at nl.avisi.structurizr.site.generatr.CreateStructurizrWorkspaceKt.createStructurizrWorkspace(CreateStructurizrWorkspace.kt:10)
at nl.avisi.structurizr.site.generatr.GenerateSiteCommand.generateSiteForModelInGitRepository$lambda$4(GenerateSiteCommand.kt:130)
at nl.avisi.structurizr.site.generatr.GenerateSiteCommand.generateSiteForModelInGitRepository$lambda$5(GenerateSiteCommand.kt:117)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:667)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:765)
at nl.avisi.structurizr.site.generatr.GenerateSiteCommand.generateSiteForModelInGitRepository(GenerateSiteCommand.kt:117)
at nl.avisi.structurizr.site.generatr.GenerateSiteCommand.execute(GenerateSiteCommand.kt:77)
at kotlinx.cli.ArgParser.parse(ArgParser.kt:657)
at kotlinx.cli.ArgParser.parse(ArgParser.kt:530)
at nl.avisi.structurizr.site.generatr.AppKt.main(App.kt:13)
I likely won't have time to look into this properly before the end of the year, but the system property suggested here seems to resolve the issue, and should probably be added to the DSL parser code that builds the scripting engine.
Expected
Scripts from different workspaces should have same results regardless if they are executed sequential or in parallel.
Actual
While working on PR for parallel branch building in
structurizr-site-generatr
there is issue that when building multiple workspaces in parallel Ruby scripting context is damaged and there is stack trace error:Steps to reproduce
To reproduce that when using branch - https://github.com/FlyrInc/structurizr-site-generatr/tree/parallel-branch-building - just do (sometimes you need to re-run to get a crash - it's non deterministic):
test1-5 branches are exactly the same. They contain simple script ( link: https://github.com/FlyrInc/structurizr-site-generatr/blob/test1/docs/example/views.rb ) that is exactly the same on couple of views:
When running this without -par argument this works perfectly fine.
Version/build information
3.1.0 see: https://github.com/FlyrInc/structurizr-site-generatr/blob/ecd80c312d4625494ea78ee5df6345e16f802cb4/build.gradle.kts#L26
Severity
Minor
Priority
I'm willing to pay for this fix (add details below)
More information
No response
The text was updated successfully, but these errors were encountered: