-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Mark,

On 9/17/18 08:34, Mark Thomas wrote:
> On 17/09/18 10:50, Konstantin Kolinko wrote:
> 
> <snip/>
> 
>> Implementing auto-reloading has a caveat: there is a race
>> condition between an editor (that is used to update the file) and
>> Tomcat. It may be that Tomcat will try to read an incompletely
>> written file.
>> 
>> Also using a SAX parser + Digester, it does not check whether the
>> XML file is well-formed beforehand. It stops on the first
>> encountered error, but side effect from whatever methods it has
>> called thus far will be visible.
> 
> There is some code that handles a similar case for updated WAR
> files. We should be able to make that generic and re-use it here.

Also, when using SAX+digester, a new object should be created for the
user database and only brought into service when it's been completely
(and properly) loaded. I wouldn't suggest reading the XML directly
into the live structure.

I'm not saying that's how the code IS written... just saying how it
ought to be written, given your concerns for such a race-condition.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlugGOoACgkQHPApP6U8
pFgjCg//acpRwULa57LwxCROI6SaM40T7gfIyiRnF4ZAwkmnIjXltBEd5m6hveBI
Ql3BKqzaiJxRD0UMZDFSpFSql+lDZpAIHJfQ5n5E11Q5RWa1V09HkLLt47QqF5F6
K4PoQG+C0YN9E2qBs3XEelsrS+19h3bE3B/FiXyxcOmmSrmUQdnrsCzChmOm7JQp
t5iNidwbnEOBxOD82UhQdCPZ2SbZ4bne7Oot0QnGocT0EZe4ePk8YxNxAI0vMc7P
amKnME+1bIvoK/mDH/LsFxyjMXbLo6TIGTfaPSNUE8EdSBKWujbFxJz/DgTpIHht
p5V/CNyOMMogYOBXw9U8UgzEW/QtEpd1n1glg4e0ysUm7kCjQ/z0crnBYu3beBPx
cKzE2P0U7rKioFGtZ9YuuwVZsUfJrBeg9DA5Gf81B3NS4bqCJwmsoXOYqeyP8S8W
BxYI/wp+rdSfZLnp20ccXzDQDlpKlEIQukM6doo6g/ITejspnoiH4CLHifmNGDdb
WSYQ88lQgbtGG0vkaldNCJX+Eptcuky9myzlO5LYA7Yr7CQsZjW5BYZCgE0vdqH6
HZOnskEFkidrNrZFVdob02xtATMlHb5Le5u1m90xUO6hkngxigkUpF+iJiAefKbW
39IjUuETaghC7t8g5QVs7XnCg/WRBO3YuFACTKeDoeZ8mhaEYnA=
=aMtP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to