-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CacheClient.close() not adhering to Closeable interface #136
Comments
Galder, thanks for reaching out. It takes me always an hour to know again, what is going on here. The TCK uses a client/server communication model for the customizations (e.g. CacheLoader, etc.). The client part, as you discovered, has no mechanism to deal with exceptions when close() is called. I did discover the same when reviewing and extending that code. But, there is no TCK test for exceptions on close (so far I have it in mind). The client part wraps the actual customization code from the TCK. So, there is something missing, but it is actually not needed. Something looks wrong. May be the error handling in the TCK can be improved. But I don't see clearly where the problem is, at the moment. What you are experiencing might be a consequence of the change in #100 Can you please check, and maybe give more information how to reproduce the problem (TCK version, cache implementation, etc....)? |
Since there is no update, I'll close this issue. As described the requested change in |
I'm sorry but if feel it's necessary. I'm having to deal with Throwable/Runtime exceptions because of misbehaving TCK classes which do not want to stick to the contract which says: |
I want this issue reopened to allow more time to discuss it. |
No problem.
Please check for the root cause of your exceptions or provide steps to reproduce. |
I've sent a PR that fixes the TCK code. Thanks |
Thanks for the PR. In the PR you now wrap all exceptions to
|
Another two remarks: Maybe your code seems to work because the tested implementations does ignore JCache/JSR107 defines that customizations may implement |
CacheEntryListenerClient
extendsCacheClient
which extendsCloseable
.Closeable defines
close()
as:But CacheClient forgets about throwing
IOException
when it overridesclose()
. Moreover,CacheClient.close()
includes calls to:Which can throw
RuntimeException
. As a result, it can happen that when closing the listener, aRuntimeException
can be thrown which ends up bubbling up, e.g.CacheClient.close()
should play nicely and whatever error it gets, throw it as aIOException
.The text was updated successfully, but these errors were encountered: