Repository navigation
Description
(async () =>{
async function fun1(){
let f1 = "D:\\a1.xlsx"
const res1 = await alasql.promise(`select * from xlsx(?) limit 100000`, [f1])
return res1
}
async function fun2(){
let f2 = "D:\\a2.xlsx"
const res2 = await alasql.promise(`select * from xlsx(?) limit 100001`, [f2])
return res2
}
try{
const orderData = await Promise.all([fun1(), fun2()])
console.log(orderData)
}catch(error){
console.error(error);
}finally{
console.log('end');
}
})()
I have an issue where I've created two asynchronous functions, fun1 and fun2, and I want to execute them in batch using Promise.all, passing parameters f1 and f2 to the xlsx(?) placeholder.
When running these functions individually, the query results are correct.
However, when I put them into Promise.all, no results are returned, and no errors are thrown.
After repeated testing, I found that if there is nothing after xlsx(?) in Promise.all, no results are returned. But if I add a limit and the number after limit is different for each function, the correct results are obtained. Yet, if the numbers after limit are the same, no results are returned again.
For example, in the code above, if both are limit 1000, no results are returned. But if one is limit 1000 and the other is limit 1001, the correct results can be obtained.
What could be the reason for this?
Activity
mathiasrw commentedon Aug 4, 2024
Hmmm. Very strange. I am wondering how the timing of these two functions might affect each other. Hmmmmmmm...
Im wondering if running async commands via a queue instead will affect this. It will effectively make multiple queries run in sequense, but getting incorrect results is worse.
znenuko commentedon Aug 21, 2024
Hi,
I reviewed the issue you reported and made some adjustments to the code to address it. Here’s the updated solution:
Explanation:
Main File: The updated code performs queries on Excel files with different limits in parallel.
Error Handling: Added additional logging to detect and handle errors during execution.
Testing: Make sure to test the functions individually and adjust limits if needed.
sharmaut commentedon Aug 7, 2025
Hi, I'm new to open source and would like to work on this issue. Is this task still available? I've read the guidelines and would appreciate any guidance you can offer.
mathiasrw commentedon Nov 19, 2025
Yep. its available.
imsanupm commentedon Feb 28, 2026
Hi, I’m interested in working on this issue. If it’s not actively being worked on, could you please assign it to me? I’m ready to start.
mathiasrw commentedon Sep 10, 2026
@imsanupm How is progress? Should I move this to some one else?
Fix Promise.all concurrency cache collision to close AlaSQL#1953 (Ala…
mathiasrw commentedon Oct 21, 2026
Fix released as part of v4.21.0