zeroshade commented on PR #2494:
URL: https://github.com/apache/arrow-adbc/pull/2494#issuecomment-2654591716

   @Niivii Okay, I think i spotted where the other potential race condition was:
   
   1. `stopFn` gets called leading to it closing the channels
   2. the goroutine that calls `executeCopyQuery` has already checked that the 
channel is still open, but hasn't called `g.Go` yet
   3. `stopFn` calls `g.Wait` and returns immediately because there are no 
running goroutines, so it continues on
   4. `g.Go` is called kicking off `executeCopyQuery` which gets in and runs 
before the calls to it happen in `stopFn`
   
   That's my theory as to how it still happened in your test. So I've updated 
`stopFn` to make sure that it won't call `g.Wait` until *after* the goroutine 
finishes running. i.e. until after it has kicked off any calls to 
`executeCopyQuery` so that `g.Wait` will definitely wait and we can't end up 
in-between. I've attached a new build that *should* include this fix to this, 
hopefully this finally fixes the problem for you! 
   
   If not, then I'm probably going to have to just rework and refactor the 
entire process here which i'm trying to avoid....
   
   
[adbc_driver_snowflake-1.5.0.tar.gz](https://github.com/user-attachments/files/18772716/adbc_driver_snowflake-1.5.0.tar.gz)
   
   
   
[adbc_driver_snowflake_manylinux.whl.tar.gz](https://github.com/user-attachments/files/18772750/adbc_driver_snowflake_manylinux.whl.tar.gz)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to