[ 
https://issues.apache.org/jira/browse/IGNITE-12646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17036299#comment-17036299
 ] 

Sergey Chugunov commented on IGNITE-12646:
------------------------------------------

[~agura],

I see your point and partly agree with you that this solution avoids and hides 
problem instead of highlighting it.

At the same time I strongly believe that logging should never throw exceptions 
like CME, especially debug logging which is used to chase difficult problems 
down, not to reveal trivial ones.

I suggest the following: we remove the flag and always catch RuntimeExceptions 
in GridToStringBuilder code but for every exception of this type caught we 
include a clear warning message in prepared String representation that should 
provide as much information as possible to find and fix the original problem in 
code.

> When DEBUG mode is enabled GridToStringBuilder may throw 
> java.util.ConcurrentModificationException
> --------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-12646
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12646
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Sergey Chugunov
>            Assignee: Sergey Chugunov
>            Priority: Major
>             Fix For: 2.9
>
>
> With DEBUG enabled many components like CommunicationSPI start to log much 
> larger chunks of information e.g. communication messages are logged as is.
> When big enough message with non-thread safe collection inside is logged by 
> communication thread it is possible that some other thread started processing 
> the same message. If processing involves modifying of the collection 
> communication thread will get ConcurrentModificationException when in the 
> middle of iterating over it.
> GridToStringBuilder should be safe from throwing this exception and 
> (optionally) any type of RuntimeException.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to