Commit 94c6161
committed
fix: revert buggy recommendation caching logic causing memory growth and latency spike
The get_recommendations_ids function introduced in commit 72f1575 contains
a critical bug: on every cache miss, it extends ids_to_add with the entire
cached_ids list for each product, causing exponential memory growth up to
MAX_CACHED_IDS (2,000,000 entries). This results in massive latency spikes
on /oteldemo.RecommendationService/ListRecommendations.
Reverts to the original direct product catalog call.1 parent 72f1575 commit 94c6161
1 file changed
+2
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
| |||
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 66 | | |
96 | 67 | | |
97 | 68 | | |
| |||
101 | 72 | | |
102 | 73 | | |
103 | 74 | | |
104 | | - | |
| 75 | + | |
| 76 | + | |
105 | 77 | | |
106 | 78 | | |
107 | 79 | | |
| |||
0 commit comments