Re: plugin:descriptor fails with java.util.NoSuchElementException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: plugin:descriptor fails with java.util.NoSuchElementException

Tibor Digana
PluginDescriptorGenerator.writeDescriptor does not use Threads so it must
be the problem that the number of calls "endElement" is greater than calls
"startElement".
https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java


On Sat, Dec 8, 2018 at 11:46 AM Tibor Digana <[hidden email]> wrote:

> I do not think it can be such JVM issue with string concatenations,
> otherwise
> all the world has the same problem.
> This type of issue is usually caused by multiple writes from multiple
> threads.
> Try to log every method with Thread id and we should see multiple ids.
> The java.io is supposed to be synchronized and thread safe. Therefore
> PrintWriter is a wrapper of thread safe implementations.
> We should use ConcurrentLinkedList and identify large functionality. If
> large methods changes status at multiple lines, then this is a critical
> section and the class must be synchronized.
>
> Cheers
> Tibor
>
>
>
>
> --
> Sent from: http://maven.40175.n5.nabble.com/Maven-Developers-f142166.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: plugin:descriptor fails with java.util.NoSuchElementException

Robert Scholte-8
I've found a few NoSuchElementException + LinkedList issues, although not  
in combination with removeLast()
But this made it clear for me there have been issues with LinkedList...

Robert

On Sun, 09 Dec 2018 17:35:45 +0100, Tibor Digana <[hidden email]>  
wrote:

> Is the issue found on Oracle Jira or bug report?
> This might to do with some build version in Java 1.7. Usually they fix it
> right after since this bug hits the JVM stability and Oracle is paying an
> attention to JIT stability.
>
>
>
> On Sun, Dec 9, 2018 at 4:36 PM Robert Scholte <[hidden email]>  
> wrote:
>
>> I have to admit that it still looks weird, but the open and close tags
>> are
>> balanced.
>> Also notice that only Java 7 (sometimes) hits this issue.
>> Gabriel was able to provide a test that always fails on Java 7, not on
>> the
>> other JDKs.
>> It must have to do with optimization when the JVM is warmed up.
>>
>> Anyway, the provided patch takes away the failures and the writing to  
>> the
>> stream is now cleaner too.
>> You might want to dive into this, but I wonder if it is worth it.
>> Issue will be resolved with the next release.
>>
>> thanks,
>> Robert
>>
>> On Sat, 08 Dec 2018 12:44:40 +0100, Enrico Olivelli  
>> <[hidden email]>
>>
>> wrote:
>>
>> > +1 for Tibor's explanation.
>> > Enrico
>> >
>> > Il sab 8 dic 2018, 12:29 Tibor Digana <[hidden email]> ha
>> > scritto:
>> >
>> >> PluginDescriptorGenerator.writeDescriptor does not use Threads so it
>> >> must
>> >> be the problem that the number of calls "endElement" is greater than
>> >> calls
>> >> "startElement".
>> >>
>> >>
>> https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java
>> >>
>> >>
>> >> On Sat, Dec 8, 2018 at 11:46 AM Tibor Digana <[hidden email]>
>> >> wrote:
>> >>
>> >> > I do not think it can be such JVM issue with string concatenations,
>> >> > otherwise
>> >> > all the world has the same problem.
>> >> > This type of issue is usually caused by multiple writes from  
>> multiple
>> >> > threads.
>> >> > Try to log every method with Thread id and we should see multiple  
>> ids.
>> >> > The java.io is supposed to be synchronized and thread safe.  
>> Therefore
>> >> > PrintWriter is a wrapper of thread safe implementations.
>> >> > We should use ConcurrentLinkedList and identify large  
>> functionality.
>> >> If
>> >> > large methods changes status at multiple lines, then this is a
>> >> critical
>> >> > section and the class must be synchronized.
>> >> >
>> >> > Cheers
>> >> > Tibor
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Sent from:
>> >> http://maven.40175.n5.nabble.com/Maven-Developers-f142166.html
>> >> >
>> >> >  
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [hidden email]
>> >> > For additional commands, e-mail: [hidden email]
>> >> >
>> >> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: plugin:descriptor fails with java.util.NoSuchElementException

Robert Scholte-8
In reply to this post by Tibor Digana
For your interest, just hit it again:

https://builds.apache.org/job/maven-box/job/maven-javadoc-plugin/job/MJAVADOC-543/

First run only fails for Build windows-jdk7-m3.2.x_build, with the  
j.u.NoSuchElementException
A rerun without any changes,now it luckily succeeds.

Robert

On Sun, 09 Dec 2018 17:35:45 +0100, Tibor Digana <[hidden email]>  
wrote:

> Is the issue found on Oracle Jira or bug report?
> This might to do with some build version in Java 1.7. Usually they fix it
> right after since this bug hits the JVM stability and Oracle is paying an
> attention to JIT stability.
>
>
>
> On Sun, Dec 9, 2018 at 4:36 PM Robert Scholte <[hidden email]>  
> wrote:
>
>> I have to admit that it still looks weird, but the open and close tags
>> are
>> balanced.
>> Also notice that only Java 7 (sometimes) hits this issue.
>> Gabriel was able to provide a test that always fails on Java 7, not on
>> the
>> other JDKs.
>> It must have to do with optimization when the JVM is warmed up.
>>
>> Anyway, the provided patch takes away the failures and the writing to  
>> the
>> stream is now cleaner too.
>> You might want to dive into this, but I wonder if it is worth it.
>> Issue will be resolved with the next release.
>>
>> thanks,
>> Robert
>>
>> On Sat, 08 Dec 2018 12:44:40 +0100, Enrico Olivelli  
>> <[hidden email]>
>>
>> wrote:
>>
>> > +1 for Tibor's explanation.
>> > Enrico
>> >
>> > Il sab 8 dic 2018, 12:29 Tibor Digana <[hidden email]> ha
>> > scritto:
>> >
>> >> PluginDescriptorGenerator.writeDescriptor does not use Threads so it
>> >> must
>> >> be the problem that the number of calls "endElement" is greater than
>> >> calls
>> >> "startElement".
>> >>
>> >>
>> https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java
>> >>
>> >>
>> >> On Sat, Dec 8, 2018 at 11:46 AM Tibor Digana <[hidden email]>
>> >> wrote:
>> >>
>> >> > I do not think it can be such JVM issue with string concatenations,
>> >> > otherwise
>> >> > all the world has the same problem.
>> >> > This type of issue is usually caused by multiple writes from  
>> multiple
>> >> > threads.
>> >> > Try to log every method with Thread id and we should see multiple  
>> ids.
>> >> > The java.io is supposed to be synchronized and thread safe.  
>> Therefore
>> >> > PrintWriter is a wrapper of thread safe implementations.
>> >> > We should use ConcurrentLinkedList and identify large  
>> functionality.
>> >> If
>> >> > large methods changes status at multiple lines, then this is a
>> >> critical
>> >> > section and the class must be synchronized.
>> >> >
>> >> > Cheers
>> >> > Tibor
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Sent from:
>> >> http://maven.40175.n5.nabble.com/Maven-Developers-f142166.html
>> >> >
>> >> >  
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [hidden email]
>> >> > For additional commands, e-mail: [hidden email]
>> >> >
>> >> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]