Skip to content
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

Cache exception handling improvement #3183

Merged

Conversation

gbarbon
Copy link
Contributor

@gbarbon gbarbon commented Dec 22, 2020

This PR introduces cache exception handling in the EntityCache class and its subclasses.

Related Issue
n/a

Description of the solution adopted
Cache errors are usually handled by the cache client (that implements the JCache interface). However, in some cases the exceptions are thrown by the cache client itself (e.g. a timeout exception). Since we are agnostic w.r.t. the underlying JCache implementation, we cannot catch precise exceptions. Thus, this PR introduces a way to treat such exceptions properly, in a conservative way w.r.t. the data, and to log them via the logger and the metrics.

Screenshots
n/a

Any side note on the changes made
n/a

@gbarbon gbarbon added the Enhancement This PR/Issue improves an part of Kapua label Dec 22, 2020
@gbarbon gbarbon self-assigned this Dec 22, 2020
@gbarbon gbarbon marked this pull request as ready for review December 22, 2020 16:38
@codecov
Copy link

codecov bot commented Dec 22, 2020

Codecov Report

Merging #3183 (bda3532) into develop (dd481c5) will decrease coverage by 0.09%.
The diff coverage is 52.38%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3183      +/-   ##
=============================================
- Coverage      63.06%   62.97%   -0.10%     
+ Complexity      2489     2485       -4     
=============================================
  Files           1118     1118              
  Lines          23146    23203      +57     
  Branches        2004     2007       +3     
=============================================
+ Hits           14597    14612      +15     
- Misses          7627     7668      +41     
- Partials         922      923       +1     
Impacted Files Coverage Δ Complexity Δ
...mmons/service/internal/cache/NamedEntityCache.java 62.96% <47.05%> (-30.38%) 0.00 <0.00> (ø)
.../device/registry/internal/DeviceRegistryCache.java 62.00% <51.61%> (-23.72%) 11.00 <0.00> (ø)
...ua/commons/service/internal/cache/EntityCache.java 69.51% <52.94%> (-14.98%) 0.00 <0.00> (ø)
...nnection/internal/DeviceConnectionServiceImpl.java 67.04% <100.00%> (-2.62%) 16.00 <2.00> (-1.00)
...rtz/persistence/KapuaQuartzConnectionProvider.java 87.50% <0.00%> (-12.50%) 4.00% <0.00%> (-1.00%)
...obDeviceManagementOperationManagerServiceImpl.java 73.17% <0.00%> (-6.10%) 13.00% <0.00%> (-1.00%)
...atch/persistence/jpa/JpaExecutionInstanceData.java 87.80% <0.00%> (-2.44%) 22.00% <0.00%> (-1.00%)
...plugin/authentication/UserAuthenticationLogic.java 81.25% <0.00%> (-1.79%) 0.00% <0.00%> (ø%)
...pse/kapua/commons/service/internal/ServiceDAO.java 74.21% <0.00%> (-0.32%) 0.00% <0.00%> (ø%)
... and 4 more

Copy link
Contributor

@riccardomodanese riccardomodanese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pr looks good to me.
If you can just remove the 2 spaces in a couple of javadocs will be good

Copy link
Contributor

@riccardomodanese riccardomodanese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pr looks good to me.
If you can just remove the 2 spaces in a couple of javadocs will be good

Signed-off-by: Gianluca Barbon <gianluca.barbon@eurotech.com>
@gbarbon gbarbon force-pushed the feature-improvedCacheExceptions branch from 3797363 to bda3532 Compare January 11, 2021 17:01
@Coduz Coduz merged commit 8b0622f into eclipse-kapua:develop Jan 12, 2021
@gbarbon gbarbon deleted the feature-improvedCacheExceptions branch January 13, 2021 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This PR/Issue improves an part of Kapua
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants