Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[6.x] Fix sqlsrv reuses broken connection #30362
Starting with Laravel 6.x, once in a while one of my queue jobs throws an exception:
As can be seen in the error message, I'm using the SQL Server driver. Unfortunately, I couldn't locate the exact issue so far. It only occured within the queue workers until now, not within the application itself. No very rare jobs are executed, it happens within very regularly executed jobs (i.e. it's unlikely the code of the jobs is the issue).
In general, it doesn't botter me too much as it only happens once a week so far with an average job count of 50k per week. The problem is that the queue workers simply escalate the exception of the job and then reuse the broken connection. To solve this, the PR attempts to force a reconnect if the exceptions contains the mentioned error message. This seems a very fitting strategy as the error explicitely says the connection is no longer usable.
The error itself seems to be very rare as there are next to no reports even outside the Laravel community.