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

Bruno Freudensprung commented on ZOOKEEPER-1835:
------------------------------------------------

Hi Rakesh,

Thank you for the review! 
My answers:
* 1, 2, 3: Sure! I will do it. 
* You are right, it is not required. I am just reluctant providing a 
Writer-based API without the possibility to provide an encoding. But I 
understand that dead code should be avoided. I will remove it.
* You are right: there are null check because I didn't want to duplicate the 
idiom (I felt the complexity was more in the idiom - try catch abort finally 
close...- than in the initialization of the objets). That is why this 
constructor is private (it handles the null check, and the public constructors 
cannot accept null parameters, excepted the encoding parameter that I will 
remove). I you prefer code duplication (for maintenability reasons) I am fine 
with that as well. Just tell me! 
Regards,
Bruno.

> dynamic configuration file renaming fails on Windows
> ----------------------------------------------------
>
>                 Key: ZOOKEEPER-1835
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1835
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: quorum
>    Affects Versions: 3.5.0
>         Environment: Windows 7 64-bit, Oracle Java  1.6.0_32-b05
>            Reporter: Bruno Freudensprung
>         Attachments: ZOOKEEPER-1835.patch
>
>
> On Windows, reconfig fails to rename the tmp dynamic config file to the real 
> dynamic config filename.
> Javadoc of java.io.File.renameTo says the behavior is highly plateform 
> dependent, so I guess this should not be a big surprise.
> The problem occurs in 
> src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java that 
> could be modified like this:
> + curFile.delete();
> if (!tmpFile.renameTo(curFile)) {
> + configFile.delete();
> if (!tmpFile.renameTo(configFile)) {
> As suggested by Alex in https://issues.apache.org/jira/browse/ZOOKEEPER-1691 
> (btw there is more information about my test scenario over there) it is a bit 
> "scary" to delete the current configuration file.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to