Commit a8918047 by Carl Bergquist Committed by GitHub

Merge pull request #11238 from grafana/11155-mysql-issue

middleware: recover and retry on session start
parents 0ef94ea4 5f511dee
......@@ -105,6 +105,18 @@ type SessionWrapper struct {
}
func (s *SessionWrapper) Start(c *macaron.Context) error {
// See https://github.com/grafana/grafana/issues/11155 for details on why
// a recover and retry is needed
defer func() error {
if err := recover(); err != nil {
var retryErr error
s.session, retryErr = s.manager.Start(c)
return retryErr
}
return nil
}()
var err error
s.session, err = s.manager.Start(c)
return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment