NPMSW fetcher fails if recipes concurrently fetch the same dependencies
I have updated several recipes to utilise the new npmsw fetcher: e.g. https://github.com/intel-iot-devkit/meta-iot-cloud/blob/master/recipes-node-red/node-red/node-red_1.0.2.bb
The recipes build fine in isolation but if you are building an image and multiple npm based recipes which have similar dependencies fetch in parallel fetching fails.
My assumption is that if multiple npmsw fetch processes try and fetch the same dependency concurrently the processes start fighting over the downloaded file in 'downloads/npm2' which then leads to checksum errors and failures.
I think for npm dependency fetching with npmsw the downloads either need to be tied to the package name or only allow a single npmsw fetching process to occur at one time so the downloads can be re-used by other recipes.
Hi Scott,
Since the npmsw fetcher only resolves urls that need to be fetched by other fetchers (wget or git), it seems to be a more global concurrent problem.
This is normally not supposed to happen because for regular recipes, a resource is linked to a recipe. If it is to be shared between several recipes, the keyword DEPENDS is used. For npm this is different because it would mean that thousands of recipes would have to be created to build npm applications.
The problem should be reproducible by creating several recipes with the same resource to fetch. And I think it has something to do with the lock file.
It's a difficult time right now and it's going to be hard for me to fix this problem but I'll try to look into it.
Best regards,
Jean-Marie Lemetayer
Quoted 19 lines · On Apr 30, 2020, at 3:11 PM, scott r ware [email protected] wrote:
I have updated several recipes to utilise the new npmsw fetcher: e.g. [
https://github.com/intel-iot-devkit/meta-iot-cloud/blob/master/recipes-node-red/node-red/node-red_1.0.2.bb
|
https://github.com/intel-iot-devkit/meta-iot-cloud/blob/master/recipes-node-red/node-red/node-red_1.0.2.bb
]The recipes build fine in isolation but if you are building an image and multiple npm based recipes which have similar dependencies fetch in parallel fetching fails.
My assumption is that if multiple npmsw fetch processes try and fetch the same dependency concurrently the processes start fighting over the downloaded file in 'downloads/npm2' which then leads to checksum errors and failures.
I think for npm dependency fetching with npmsw the downloads either need to be tied to the package name or only allow a single npmsw fetching process to occur at one time so the downloads can be re-used by other recipes.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Scott,
I have created a BZ to track the issue. Could you add some logs (if possible) ? Thanks
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13903
Best regards,
Jean-Marie
Quoted 41 lines · On May 2, 2020, at 3:02 PM, Jean-Marie Lemetayer…
Hi Scott,
Since the npmsw fetcher only resolves urls that need to be fetched by other fetchers (wget or git), it seems to be a more global concurrent problem.
This is normally not supposed to happen because for regular recipes, a resource is linked to a recipe. If it is to be shared between several recipes, the keyword DEPENDS is used. For npm this is different because it would mean that thousands of recipes would have to be created to build npm applications.
The problem should be reproducible by creating several recipes with the same resource to fetch. And I think it has something to do with the lock file.
It's a difficult time right now and it's going to be hard for me to fix this problem but I'll try to look into it.
Best regards,
Jean-Marie LemetayerQuoted 19 lines · On Apr 30, 2020, at 3:11 PM, scott r ware [email protected] wrote:
I have updated several recipes to utilise the new npmsw fetcher: e.g. [
https://github.com/intel-iot-devkit/meta-iot-cloud/blob/master/recipes-node-red/node-red/node-red_1.0.2.bb
|
https://github.com/intel-iot-devkit/meta-iot-cloud/blob/master/recipes-node-red/node-red/node-red_1.0.2.bb
]The recipes build fine in isolation but if you are building an image and multiple npm based recipes which have similar dependencies fetch in parallel fetching fails.
My assumption is that if multiple npmsw fetch processes try and fetch the same dependency concurrently the processes start fighting over the downloaded file in 'downloads/npm2' which then leads to checksum errors and failures.
I think for npm dependency fetching with npmsw the downloads either need to be tied to the package name or only allow a single npmsw fetching process to occur at one time so the downloads can be re-used by other recipes.