Skip to content
This repository has been archived by the owner. It is now read-only.

java.util.ConcurrentModificationException stack trace #460

Open
gkfabs opened this issue Jul 20, 2023 · 0 comments
Open

java.util.ConcurrentModificationException stack trace #460

gkfabs opened this issue Jul 20, 2023 · 0 comments

Comments

@gkfabs
Copy link

gkfabs commented Jul 20, 2023

I have a webpage where I upload a file with the environment zio and zio http.

                Components.button(
                  "Submit",
                  access =>
                    for {
                      files <- access.listFiles(fileInput)
                      _ <- ZIO.foreachDiscard(files) { fileHandle =>
                        (for {
                          stream <- access.downloadFileAsStream(fileHandle)
                          data = stream.toZStream
                            .mapChunks(_.flatMap(_.asArray))
                            .rechunk(8192)
                            .via(
                              ZPipeline.utf8Decode >>> ZPipeline.mapChunks[String, Char](_.flatten)
                            )
                        } yield ())

If I upload a file >6Mo, I get the stack trace exception

level=DEBUG ts=2023-07-18T16:11:57.946Z l=(Zio2Effect.scala:91) message="Fiber zio-fiber-10395 did not handle an error" fiber=zio-fiber-10395 error="java.util.ConcurrentModificationException: mutation occurred during iteration
at scala.collection.mutable.MutationTracker$.checkMutations(MutationTracker.scala:43)
at scala.collection.mutable.CheckedIndexedSeqView$CheckedIterator.hasNext(CheckedIndexedSeqView.scala:47)
at scala.collection.mutable.Growable.addAll(Growable.scala:61)
at scala.collection.mutable.Growable.addAll$(Growable.scala:57)
at scala.collection.immutable.VectorBuilder.addAll(Vector.scala:1822)
at scala.collection.immutable.Vector$.from(Vector.scala:1394)
at scala.collection.IterableOnceOps.toVector(IterableOnce.scala:1317)
at scala.collection.IterableOnceOps.toVector$(IterableOnce.scala:1317)
at scala.collection.AbstractIterable.toVector(Iterable.scala:933)
at korolev.effect.Stream$$anon$`10.`$anonfun$pull$19(Stream.scala:361)
at zio.ZIO.$`anonfun`$map$2(ZIO.scala:960)
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:904)
at zio.internal.FiberRuntime.evaluateEffect(FiberRuntime.scala:381)
at zio.internal.FiberRuntime.evaluateMessageWhileSuspended(FiberRuntime.scala:504)
at zio.internal.FiberRuntime.drainQueueOnCurrentThread(FiberRuntime.scala:220)
at zio.internal.FiberRuntime.run(FiberRuntime.scala:139)
at zio.internal.ZScheduler$$anon$4.run(ZScheduler.scala:476) "
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant