aws / aws/amazon-redshift-python-driver

[Bug] BrokenPipe: server socket closed error when we execute any dbt model in dbt core with redshift adapter

Đang mở
#252 11 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
220
Fork
86
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

We are facing an issue if we execute a dbt model in dbt core with redshift adapter in multi nodes or multi threads. We did some analysis to find the reason for a failure by checking the dbt logs and we found that at some random point one of the threads was going to idle state for a certain period of time and it was not executing any tasks sent to it and eventually it got failed with the below statement.
BrokenPipe: server socket closed. Please check that client side networking configurations such as Proxies, firewalls, VPN, etc. are not affecting your network connection.
We suspect this could be because of introduction of redshift_connector in dbt-redshift adapter by replacing psycopg2. We weren't facing any such issues in dbt older versions which used psycopg2.
Attaching the context from dbt log file
```
13:28:59.394786 [debug] [Thread-1 (]: Elementary: [dbt_tests] Artifacts changed.
.
.
.
13:53:01.835859 [debug] [Thread-1 (]: Elementary: Deleting from and inserting to: "elementary"."dbt_tests"
13:53:01.859812 [debug] [Thread-1 (]: Using redshift connection "model.elementary.dbt_tests"
13:53:01.860853 [debug] [Thread-1 (]: On model.elementary.dbt_tests: /* {"app": "dbt", "dbt_version": "1.8.9", "profile_name": "", "target_name": "", "node_id": "model.elementary.dbt_tests"} */

13:53:01.863164 [debug] [Thread-1 (]: Redshift adapter: Rolling back transaction.
13:53:01.864028 [debug] [Thread-1 (]: On model.elementary.dbt_tests: ROLLBACK
13:53:01.866800 [debug] [Thread-1 (]: Failed to rollback 'model.elementary.dbt_tests'
13:53:01.873315 [debug] [Thread-1 (]: On model.elementary.dbt_tests: Close
13:53:01.879586 [debug] [Thread-1 (]: Runtime Error in model dbt_tests (models/edr/dbt_artifacts/dbt_tests.sql)
BrokenPipe: server socket closed. Please check that client side networking configurations such as Proxies, firewalls, VPN, etc. are not affecting your network connection.
13:53:01.881652 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '382ae431-f242-4924-a625-8b4dd918ff58', 'context': []}
13:53:01.882856 [error] [Thread-1 (]: 1 of 1 ERROR creating sql incremental model elementary.dbt_tests .......... [ERROR in 1646.81s]
```

As you can see last time when connection was used in Thread-1 was at 13:28:59.394786 (first line)
After almost 25mins dbt got back to this connection to sent the next statement but the connection was no longer open
There is no keep_alive option in redshift_connector - this is something we had specified in the old redshift adapter.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

No repository files, tests, or entry points are named. Start by reproducing a multi-threaded dbt model run with the Redshift adapter and compare the connection lifecycle around the idle period shown in the logs; done means identifying and verifying the cause of the BrokenPipe failure.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
databases
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.