adobe / adobe/aio-cli-plugin-app-dev

dev command should run actions in an isolated process

Đang mở
#110 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
JavaScript
Star
2
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Describe the bug**
Currently all action code is executed in the same process, which could potentially lead to errors if any action code is modifying process.env it affects the global space.

**To Reproduce**
write 2 actions where 1 is has a sleep function
```
const sleep = async (ms) => new Promise(resolve => setTimeout(resolve, ms))

// main function that will be executed by Adobe I/O Runtime
async function main (params) {

let before = process.env.__OW_ACTIVATION_ID
console.log('before', before)
await sleep(10000)
let after = process.env.__OW_ACTIVATION_ID
console.log('after', after)
return {
statusCode: 200,
body: {
before,
after,
wasCorrupted: (before !== after)
}
}
}

exports.main = main
```

aio app dev and call this action
while it is running, use curl to call the other action

**Expected behavior**
activationId has not changed when sleeper returns
```
time: 10015 ms
{
"before": "d5afdd731a1d2384c55b8bcdb1a453e6",
"after": "d5afdd731a1d2384c55b8bcdb1a453e6",
"wasCorrupted": false
}
```

**Screenshots**
```
time: 10015 ms
{
"before": "d5afdd731a1d2384c55b8bcdb1a453e6",
"after": "f53548458df5870656339859f7af28e6",
"wasCorrupted": true
}
```

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.

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

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

Hướng nghiên cứu

Bắt đầu với lệnh `aio app dev` và điểm vào của action `main` được hiển thị trong bản tái hiện. Chạy đồng thời hai action, bao gồm cả thời gian sleep 10 giây, và quan sát xem `process.env.__OW_ACTIVATION_ID` có thay đổi giữa `before` và `after` hay không. Hoàn tất khi các action chạy đồng thời không còn ảnh hưởng đến môi trường process của nhau.

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
Lĩnh vực
cli
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
Khá rõ ràng
Mức phù hợp với người mới
35/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.