Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync issue for MaxQueueSize #53

Closed
kostaskougios opened this issue May 5, 2015 · 2 comments
Closed

sync issue for MaxQueueSize #53

kostaskougios opened this issue May 5, 2015 · 2 comments

Comments

@kostaskougios
Copy link

MaxQueueSize is populated in one thread and then used in an other without sync. This randomly (if a code runs for hundreds of times) results in the Parser thread to read MaxQueueSize as 0. In turn this fails with an exception:

Exception in thread "XMLEventReader" java.lang.IllegalArgumentException
at java.util.concurrent.LinkedBlockingQueue.(LinkedBlockingQueue.java:261)
at scala.xml.pull.ProducerConsumerIterator$class.scala$xml$pull$ProducerConsumerIterator$$queue(XMLEventReader.scala:133)
at scala.xml.pull.XMLEventReader.scala$xml$pull$ProducerConsumerIterator$$queue$lzycompute(XMLEventReader.scala:27)
at scala.xml.pull.XMLEventReader.scala$xml$pull$ProducerConsumerIterator$$queue(XMLEventReader.scala:27)
at scala.xml.pull.ProducerConsumerIterator$$anonfun$produce$1.apply$mcV$sp(XMLEventReader.scala:144)
at scala.xml.pull.ProducerConsumerIterator$$anonfun$produce$1.apply(XMLEventReader.scala:144)
at scala.xml.pull.ProducerConsumerIterator$$anonfun$produce$1.apply(XMLEventReader.scala:144)
at scala.xml.pull.ProducerConsumerIterator$class.interruptibly(XMLEventReader.scala:125)
at scala.xml.pull.XMLEventReader.interruptibly(XMLEventReader.scala:27)
at scala.xml.pull.ProducerConsumerIterator$class.produce(XMLEventReader.scala:144)
at scala.xml.pull.XMLEventReader.produce(XMLEventReader.scala:27)
at scala.xml.pull.XMLEventReader$Parser$$anonfun$setEvent$1.apply(XMLEventReader.scala:68)
at scala.xml.pull.XMLEventReader$Parser$$anonfun$setEvent$1.apply(XMLEventReader.scala:68)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:35)
at scala.xml.pull.XMLEventReader$Parser.setEvent(XMLEventReader.scala:68)
at scala.xml.pull.XMLEventReader$Parser.run(XMLEventReader.scala:95)
at java.lang.Thread.run(Thread.java:745)

@kostaskougios
Copy link
Author

Might be related because I am overriding the value like:

val xer = new XMLEventReader(fixedSource) {
// tmp workaround till https://groups.google.com/forum/#!topic/scala-user/OO9t2pUAeZY is resolved
override val MaxQueueSize = Integer.MAX_VALUE
}

That is due to the stop() bug I opened earlier on today.

@SethTisue
Copy link
Member

XMLEventReader will be deprecated entirely in the next release (#193, #199)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants