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

ASF subversion and git services commented on GEODE-8789:
--------------------------------------------------------

Commit 1da2e6558d5ea57c25762e25689c2bede1ca3ed2 in geode's branch 
refs/heads/develop from Donal Evans
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=1da2e65 ]

GEODE-8789: Prevent region name from being incorrectly logged twice (#5850)

- The String containing the reason for the exception should
not contain the region name

Authored-by: Donal Evans <doev...@vmware.com>

> Inconsistent logging when using BaseCommand.writeRegionDestroyedEx() leads to 
> region name being repeated.
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-8789
>                 URL: https://issues.apache.org/jira/browse/GEODE-8789
>             Project: Geode
>          Issue Type: Improvement
>          Components: logging
>    Affects Versions: 1.12.0, 1.14.0, 1.13.1
>            Reporter: Donal Evans
>            Assignee: Donal Evans
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.14.0
>
>
> The method BaseCommand.writeRegionDestroyedEx() takes a String "title" and 
> String "regionName" and uses them to construct an exception message. However, 
> some areas of code that call this method format the "title" String to already 
> contain the region name, leading to the name being logged twice and 
> potentially causing confusion. Calls to this method should be changed to not 
> include the region name in the "title" String.
> {code:java}
> protected static void writeRegionDestroyedEx(Message msg, String regionName, 
> String title,
>       ServerConnection serverConnection) throws IOException {
>     String reason = serverConnection.getName() + ": Region named " + 
> regionName + title;
>     RegionDestroyedException ex = new RegionDestroyedException(reason, 
> regionName);
>     if (serverConnection.getTransientFlag(REQUIRES_CHUNKED_RESPONSE)) {
>       writeChunkedException(msg, ex, serverConnection);
>     } else {
>       writeException(msg, ex, false, serverConnection);
>     }
>   }
> {code}



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

Reply via email to