Skip to content

hang after Reset Connection and SET NAMES in same packet #1260

Closed as not planned
@syndicatedshannon

Description

@syndicatedshannon

Software versions
MySqlConnector version: 2.1.2 and 2.2.2 both exhibit this behavior
Server type and version: AWS RDS MySQL 5.7.12
.NET version: NET6.0 (.NET Core)
ORM NuGet packages and versions: Pomelo.EntityFrameworkCore.MySql 6.0.2

Describe the bug
The first Query request on a connection completes successfully, but the second is never sent (on the wire).

This happens on consistently 2 out of 4 AWS RDS servers I test, while the other 2 consistently succeed on the second request. All report they are running the same version (5.7.12). Between server tests I only change connection strings, and the only deltas in the connection strings are the host/uid/password.

Looking at a trace, an obvious difference is in the connection reset. In all cases the connection reset does not occur until after the first results have been returned and my software requests the next query from EfCore/Pomelo/MySqlConnection, and in all cases a SET NAMES utf8mb4 query is performed after the reset. However:

  • in the successful scenario, the Reset Connection command is in a separate preceding packet and each receive a separate Response OK reply
  • in the failing scenario, the SET NAMES immediately follows the Reset Connection in the same packet. The server returns a single Response OK reply, and the client query method never returns

I can't see why my client consistently treats half these servers differently. I wasn't able to spot any relevant differences in the trace prior to this diverging behavior, though intuitively it seems it must be there and I can't find it.

The second query succeeds for all servers if I disable connection reset (;ConnectionReset=false)

I reviewed the following, which appear related, but not directly enough to allow me to troubleshoot myself.

#66
#1236
#1089

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions