- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1
 
Fix PG::UnableToSend using a reconnect #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| 
           @amicojeko This should fix our issues, please review  | 
    
        
          
                lib/ruote/postgres/storage.rb
              
                Outdated
          
        
      | yield | ||
| end | ||
| rescue *CONNECTION_ERRORS => e | ||
| if @retry_on_connection_error && retries < 1 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So will retry only 1 time? Can be better to set a max_retries param to retry N times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting but In my view it's not needed. The kind of error we are facing it's a network issue that closes the PG connection. With 1 retry it reconnects and it works, if that's not the case it may well be another issue and we just raise the error.
| 
           @MirkoMignini what about now?  | 
    
| 
           @lleirborras I suggest a param delay (ms) between retries. This way we can test N times for a long time so we will see if is stuck forever or is a temporary network issue  | 
    
| 
           @lleirborras This reconnect didn't solve the problem as quasar, that is using this branch, is still affected. Our rails applications aren't affected by PS:UnableToSend problem but only this gem, I see that rails internally retry one time in case of error but using the postgres reset method, I will try the same!  | 
    
| 
           @lleirborras I added a 0.5 sleep between every retry, I will test in scriptoria (and I will increase also the max retries a little bit)  | 
    
No description provided.