> what guarantees do/can we give re. this file handle within this context.
Can it suddenly go away (e.g. because of gc or internal re-organisation)?
How do we establish, test and maintain (e.g. from regressions) such
guarantees?

Logically it should not go away suddenly. So GC logic should be aware of
such "inUse" instances (there is already such support for inUse cases).
Such a requirement can be validated via integration testcase

>  and more concerningly, how do we protect Oak from data corruption by
misbehaving clients? E.g. clients writing on that handle or removing it?
Again, if this is public API we need ways to test this.

Not sure by misbehaving client - Is it malicious (by design) or badly
written code. For later yes that might pose a problem but we can have some
defense. I would expect the code making use of the api to behave properly.
In addition as proposed above [1] for FileDataStore we can provide a
symlinked file reference which exposes a read only file handle. For
S3DataStore code should have access to aws credentials to perform any write
operation, which should be a sufficient defense

> In an earlier mail you quite fittingly compared this to commit hooks,
which for good reason are an internal SPI.

Bit of nit pick here ;) As per Jcr class [1] one can provide a CommitHook
instance so not sure if we can term it internal. However point that I
wanted to emphasize is that Oak does provide some critical extension point
and with a misbehaving code one can shoot himself at foot and as
implementation only so much can be done.

regards
Chetan
[1]
http://markmail.org/thread/6mq4je75p64c5nyn#query:+page:1+mid:237kzuhor5y3tpli+state:results
[2]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/Jcr.java#L190

Chetan Mehrotra

Reply via email to