Skip to content

Commit e74e518

Browse files
committed
cc cache: document danger of only-incremental
commit_hash:a925f592969cc149d61f1eefad01f46d4a309cca
1 parent ee93968 commit e74e518

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/include/userver/cache/caching_component_base.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ namespace components {
8787
/// will be triggered each `update-interval` (adjusted by jitter).
8888
/// * `only-incremental`: only `update-interval` must be specified. UpdateType::kFull is triggered
8989
/// on the first update, afterwards UpdateType::kIncremental will be triggered
90-
/// each `update-interval` (adjusted by jitter).
90+
/// each `update-interval` (adjusted by jitter). Warning: use carefully.
91+
/// If the cache loses any data, it is lost until service restart (in the worst case). If possible,
92+
/// use `full-and-incremental` with rare full updates, and completely avoid `only-incremental`.
93+
/// Also you have to explicitly remove outdated items from the cache container, otherwise
94+
/// the cache might grow indefinitely and eventually will lead to OOM.
95+
/// If not sure, just use `full-and-incremental`.
9196
///
9297
/// ### Avoiding memory leaks
9398
///

0 commit comments

Comments
 (0)