Skip to content

Commit e971d94

Browse files
authored
KAFKA-8784: remove default close for RocksDBConfigSetter (apache#10416)
Remove the default close implementation for RocksDBConfigSetter to avoid accidental memory leaks via C++ backed objects which are constructed but not closed by the user Reviewers: Anna Sophie Blee-Goldman <[email protected]>
1 parent fb2eef9 commit e971d94

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

docs/streams/upgrade-guide.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ <h1>Upgrade Guide and API Changes</h1>
9393
</p>
9494

9595
<h3><a id="streams_api_changes_300" href="#streams_api_changes_300">Streams API changes in 3.0.0</a></h3>
96+
<p>
97+
We removed the default implementation of <code>RocksDBConfigSetter#close()</code>.
98+
</p>
9699
<p>
97100
We removed the following deprecated APIs:
98101
</p>

streams/src/main/java/org/apache/kafka/streams/state/RocksDBConfigSetter.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,5 @@ public interface RocksDBConfigSetter {
5757
* @param storeName the name of the store being configured
5858
* @param options the RocksDB options
5959
*/
60-
default void close(final String storeName, final Options options) {
61-
LOG.warn("The default close will be removed in 3.0.0 -- you should overwrite it if you have implemented RocksDBConfigSetter");
62-
}
60+
void close(final String storeName, final Options options);
6361
}

streams/src/test/java/org/apache/kafka/test/MockRocksDbConfigSetter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ public void setConfig(final String storeName, final Options options, final Map<S
3232

3333
configMap.putAll(configs);
3434
}
35+
36+
@Override
37+
public void close(String storeName, Options options) {
38+
}
3539
}

0 commit comments

Comments
 (0)