[ 
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1388?page=all ]

Darryl Miles updated XDT-1388:
------------------------------

    Attachment: xdoclet_dlm_patch_XDT-1388.diff

This is a patch is against recent CVS HEAD and addresses the problems in my 
report.  It has been tested on Linux and I'd appreciate testing on Win32 
platform, simply edit an attribute in your test project, run patched XDoclet 
over it and confirm the change appears in web.xml.

* With this patch the web.xml is only updated by an atomic filesystem rename() 
operation after the new version has been constructed.

* Because its built into a temp file there is no way for a corrupted version to 
get left behind or ever be seen by any other tools or container.


> Invalid files left behind after failed build process
> ----------------------------------------------------
>
>          Key: XDT-1388
>          URL: http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1388
>      Project: XDoclet
>         Type: Bug
>     Versions: 1.2.3
>     Reporter: Darryl Miles
>     Assignee: xdoclet-devel (Use for new issues)
>  Attachments: xdoclet_dlm_patch_XDT-1388.diff
>
>
> I think that XDoclet during its building of output files is truncating the 
> destination file and writing new data directly into it, instead of 
> generateing the new file as a tmp file in the same dir first then renaming to 
> overwrite.  If an error occurs during the writing process XDoclet seems to 
> just abort where it is and leave behind a half generated descriptor file.
> Bad generation sequence for output.xml:
> Open output.xml with O_TRUNC
> Read source files writing directly to output.xml
> Close output.xml
> Good generation sequence for output.xml:
> Unlink output.xml.tmp (just in case)
> Open output.xml.tmp with O_TRUNC|O_EXCL (any securly generated tmpfile  in 
> same dir will do)
> Read source files writing directly to output.xml
> Close output.xml.tmp
> Rename output.xml.tmp to output.xml

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to