Remove item from the active queue on connection error
Fixed indentation
Merge pull request #2442 from chornyi/1.7.0

Remove item from the active queue on connection error