Jeffrey Rosselle
Jeffrey Rosselle

Reputation: 765

Azure workerrole fails to start after swap

When I deploy my project to Azure staging area. My workerrole starts and does what it's suppose to do.

But the minute after I press swap, so the staging area is pushed to production area, my workkerrole gets the following error:

A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)

Then the workerrole will stay idle for a few hours before actually start working again. If I would reboot the instance the workerrole is on, it would start immediately after reboot.

Does anyone know how to fix this without rebooting every time?

Upvotes: 0

Views: 50

Answers (1)

kwill
kwill

Reputation: 10998

When you perform a swap, the public IP address (VIP) will change. This means that outgoing TCP connections will change the source IP to the new VIP. If you keep a persistent connection to something like Azure SQL DB then the external resource (SQL in this case) may terminate the connection when it sees the new source IP address.

The solution to this is the same type of best practices you should already be implementing - retry connections.

Without knowing more about how you are creating your SQL connections it is hard to be more specific, but you can do a search for "sql azure retry connections" and you will see lots of guidance. I would start with http://social.technet.microsoft.com/wiki/contents/articles/4235.retry-logic-for-transient-failures-in-windows-azure-sql-database.aspx and http://azure.microsoft.com/blog/2010/05/11/connections-and-sql-azure/.

Upvotes: 1

Related Questions