Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions airbyte_cdk/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,15 @@ def read(

# The Airbyte protocol dictates that counts be expressed as float/double to better protect against integer overflows
stream_message_counter: DefaultDict[HashableStreamDescriptor, float] = defaultdict(float)

# DO NOT MERGE: intentional memory leak to test graceful OOM shutdown.
# Each consumed record is duplicated 500x into a growing list to inflate memory quickly.
_leaked_records: list[Any] = []

for message in self.source.read(self.logger, config, catalog, state):
yield self.handle_record_counts(message, stream_message_counter)
if message.type == Type.RECORD:
_leaked_records.extend([message.record] * 500)
try:
self._memory_monitor.check_memory_usage()
except AirbyteTracedException:
Expand Down
Loading