On Thursday, April 13, 2017 at 10:03:07 AM UTC-7, Nicolò Benigni wrote:
>
> I am having serious problem when running code in multiprocess application. 
> In my case I use Resque, and has a pool (using resque-pool gem) of 2 
> Resque's worker that listen for task to be completed on a single "Queue". 
> The problem is, if I use only one worker, everything work smooth and fine, 
> when I enable the second worker, and the 2 start working in parallel, I get 
> random, non-sense error always from Sequel...
>
> I get unreal validation errors (email_address already exists...), or more 
> serious, low level ones like Sequel::NoExistingObject in an apparently 
> random way.
>
>
> I am sure that I am missing something about some rules that I need to 
> maintain in my code when using Sequel in an environment like this, with 
> multiprocess running in parallel, but I cannot get much info out of there.. 
> would appreciate a lot som help to find the right direction!
>

Not sure how rescue-pool works, but if it is forking processes and your 
aren't disconnecting the database connections before fork, that's probably 
what is causing it.  Call Database#disconnect before forking to ensure each 
worker process uses its own connections.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to