loopbackio / loopbackio/loopback-connector-postgresql
Error when using transaction timeout
Đang mở
Chưa có ai nhận issue này.
bug
- Ngôn ngữ chính
- JavaScript
- Star
- 118
- Fork
- 184
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 5
Mô tả
Steps to reproduce
loopback-connector-postgresql version is 5.3.0
node version is v14.1.0
await app.datasources.db.transaction(async myTxModels => {
await customFunction(element, {
db1: db1TxModels,
db2: db2Models
}).catch(err => { throw err });
}, { timeout: 240000 });
Current Behavior
aftersome time, app crashes with the following error
tx.notifyObserversOf('timeout', context, function(err) {
^
TypeError: tx.notifyObserversOf is not a function
at Timeout._onTimeout (\node_modules\loopback-connector\lib\transaction.js:124:12)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện lỗi timeout của giao dịch với loopback-connector-postgresql 5.3.0 và Node v14.1.0, sau đó kiểm tra node_modules/loopback-connector/lib/transaction.js tại dòng 124 cùng với phần xử lý timeout xung quanh. Được xem là hoàn tất khi nhánh timeout không còn gây ra “tx.notifyObserversOf is not a function” hoặc làm ứng dụng bị crash.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, node.js, postgresql
- Lĩnh vực
- backend, databases
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100