[
https://issues.apache.org/jira/browse/GEODE-8789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249366#comment-17249366
]
ASF GitHub Bot commented on GEODE-8789:
---------------------------------------
DonalEvans opened a new pull request #5850:
URL: https://github.com/apache/geode/pull/5850
- Do not format the String containing the reason for the exception to
contain the region name
Authored-by: Donal Evans <[email protected]>
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced in
the commit message?
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically `develop`)?
- [ ] Is your initial contribution a single, squashed commit?
- [ ] Does `gradlew build` run cleanly?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
### Note:
Please ensure that once the PR is submitted, check Concourse for build
issues and
submit an update to your PR as soon as possible. If you need help, please
send an
email to [email protected].
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> 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
> Reporter: Donal Evans
> Assignee: Donal Evans
> Priority: Major
>
> 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)