Skip to content

Commit ad8e07d

Browse files
authored
Merge pull request #53 from sauravkumarrr/memory-leak-fix
fix(source): Memory leak in keys source task (offsets never cleared)
2 parents e29e411 + 46c2346 commit ad8e07d

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

core/redis-kafka-connect/src/main/java/com/redis/kafka/connect/source/RedisKeysSourceTask.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ public class RedisKeysSourceTask extends SourceTask {
4141

4242
public static final Schema KEY_SCHEMA = Schema.STRING_SCHEMA;
4343

44-
/**
45-
* The offsets that have been processed and that are to be acknowledged by the
46-
* reader in {@link RedisKeysSourceTask#commit()}.
47-
*/
48-
private final List<Map<String, ?>> sourceOffsets = new ArrayList<>();
4944
private final ToStructFunction converter = new ToStructFunction();
5045
private final Clock clock;
5146

@@ -96,17 +91,10 @@ public void start(Map<String, String> props) {
9691
}
9792
}
9893

99-
private void addSourceOffset(Map<String, ?> sourceOffset) {
100-
sourceOffsets.add(sourceOffset);
101-
}
102-
10394
@Deprecated
10495
@Override
10596
public void commitRecord(SourceRecord sourceRecord) throws InterruptedException {
106-
Map<String, ?> currentOffset = sourceRecord.sourceOffset();
107-
if (currentOffset != null) {
108-
addSourceOffset(currentOffset);
109-
}
97+
// do nothing - offset tracking not needed for Redis key monitoring
11098
}
11199

112100
@Override

0 commit comments

Comments
 (0)