Default 2GB memory limit not being observed

  • Is this your first time deploying Airbyte?: No
  • OS Version / Instance: Oracle Linux 8 Ec2 Instance
  • Memory / Disk: 16GB / 100GB
  • Deployment: Docker
  • Airbyte Version: 0.40.22
  • Source name/version: Postgres 1.0.33
  • Destination name/version: S3 0.3.17
  • Step: The issue is happening during sync
  • Description:

I’m attempting to inital sync approximately 666 tables for a number of databases.
In this scenario, I’m only doing this for 1 database which results in 2.02GB of initial sync data, 479,832 records.

The documentation states that a container’s memory limit should default to 2GB, however, I’m seeing it use more than this, which will occasionally crash the EC2 instance requiring a restart.

Although this exhausted the memory, it was able to complete the sync on this occasion.

I’ve attempted to set the max memory usage using JOB_MAIN_CONTAINER_MEMORY_LIMIT=3g, however, this just kills the sync when the limit is reached instead of limiting it as expected.

Here are the logs from a previous sync that hit the limit and died.

2022-12-14 11:53:50 source > Terminating due to java.lang.OutOfMemoryError: Java heap space
...
...
2022-12-14 11:53:51 ERROR i.a.w.g.DefaultReplicationWorker(replicate):229 - Sync worker failed.
java.util.concurrent.ExecutionException: io.airbyte.workers.general.DefaultReplicationWorker$SourceException: Source cannot be stopped!
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?]
        at io.airbyte.workers.general.DefaultReplicationWorker.replicate(DefaultReplicationWorker.java:221) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
        at io.airbyte.workers.general.DefaultReplicationWorker.run(DefaultReplicationWorker.java:157) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
        at io.airbyte.workers.general.DefaultReplicationWorker.run(DefaultReplicationWorker.java:80) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
        at io.airbyte.workers.temporal.TemporalAttemptExecution.lambda$getWorkerThread$4(TemporalAttemptExecution.java:192) ~[io.airbyte-airbyte-workers-0.40.22.jar:?]
        at java.lang.Thread.run(Thread.java:1589) ~[?:?]
        Suppressed: io.airbyte.workers.exception.WorkerException: Source process exit with code 3. This warning is normal if the job was cancelled.
                at io.airbyte.workers.internal.DefaultAirbyteSource.close(DefaultAirbyteSource.java:144) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
                at io.airbyte.workers.general.DefaultReplicationWorker.replicate(DefaultReplicationWorker.java:178) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
                at io.airbyte.workers.general.DefaultReplicationWorker.run(DefaultReplicationWorker.java:157) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
                at io.airbyte.workers.general.DefaultReplicationWorker.run(DefaultReplicationWorker.java:80) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
                at io.airbyte.workers.temporal.TemporalAttemptExecution.lambda$getWorkerThread$4(TemporalAttemptExecution.java:192) ~[io.airbyte-airbyte-workers-0.40.22.jar:?]
                at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: io.airbyte.workers.general.DefaultReplicationWorker$SourceException: Source cannot be stopped!
        at io.airbyte.workers.general.DefaultReplicationWorker.lambda$readFromSrcAndWriteToDstRunnable$6(DefaultReplicationWorker.java:328) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
        at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        ... 1 more
Caused by: io.airbyte.workers.exception.WorkerException: Source process exit with code 3. This warning is normal if the job was cancelled.
        at io.airbyte.workers.internal.DefaultAirbyteSource.close(DefaultAirbyteSource.java:144) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
        at io.airbyte.workers.general.DefaultReplicationWorker.lambda$readFromSrcAndWriteToDstRunnable$6(DefaultReplicationWorker.java:326) ~[io.airbyte-airbyte-commons-worker-0.40.22.jar:?]
        at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        ... 1 more

Hello there! You are receiving this message because none of your fellow community members has stepped in to respond to your topic post. (If you are a community member and you are reading this response, feel free to jump in if you have the answer!) As a result, the Community Assistance Team has been made aware of this topic and will be investigating and responding as quickly as possible.
Some important considerations that will help your to get your issue solved faster:

  • It is best to use our topic creation template; if you haven’t yet, we recommend posting a followup with the requested information. With that information the team will be able to more quickly search for similar issues with connectors and the platform and troubleshoot more quickly your specific question or problem.
  • Make sure to upload the complete log file; a common investigation roadblock is that sometimes the error for the issue happens well before the problem is surfaced to the user, and so having the tail of the log is less useful than having the whole log to scan through.
  • Be as descriptive and specific as possible; when investigating it is extremely valuable to know what steps were taken to encounter the issue, what version of connector / platform / Java / Python / docker / k8s was used, etc. The more context supplied, the quicker the investigation can start on your topic and the faster we can drive towards an answer.
  • We in the Community Assistance Team are glad you’ve made yourself part of our community, and we’ll do our best to answer your questions and resolve the problems as quickly as possible. Expect to hear from a specific team member as soon as possible.

Thank you for your time and attention.
Best,
The Community Assistance Team

Hey @Billy_Hudson, thanks so much for bringing this up and for all the details! Could you please make a GitHub issue for this so it can get fixed?

Hey @natalyjazzviolin, I’ve raised a GitHub Issue here;