Skip to content

Connection between dockerized application and azure sql hangs after ef core upgrade to 3.1 #20316

@Arcanst

Description

@Arcanst

Our solution consists of almost 40 projects, 6 of them are runnable applications. In the simplest scenario we only need two applications running - webapi and worker which communicate through rabbitmq in a command-commandhandler pattern. We use .netcoreapp3.1 (to which we recently migrated from 2.2) and ef core 3.1 (to which we migrated afterwards). After ef core migration we encountered a strange issue - our worker app just stops executing code at random place during our custom made seeding (and we can't really do anything without seeding so that's as far as we got as it comes to commands). There is no exception, no timeout, the last log we see from worker is always saying EFStatementsLogger.Log : EFInfo=[Executing DbCommand and the sql query showed in the log is never seen in the Azure Data Studio profiler so it never reaches the database. The query at which the application stops changes from seeding to seeding, there is no rule and we've been trying to find the source for 2 weeks now.

We narrowed down the issue to linux + efcore 3.1, let me quickly walk you through the investigation (tests were done repeatedly and the results were consistent):

  • running applications locally without docker and using sql express works - rules out many things but it's kinda 'works for me' so we can't rely on that
  • running applications locally without docker and using azure sql works - rules out azure sql
  • running dockerized applications on azure and using dockerized mssql express as a container instance - doesn't work
  • running applications on linux vm without docker and using azure sql doesn't work - rules out docker

We were able to narrow down the commits that could've caused the issue to six and two of them are pure migrations (we flattened a huge number of migrations into one - twice during that task). 90% changes in these four commits are about ef core's fluent api that wasn't working after ef core upgrade, indexes, includes, custom projections (nothing big - mostly changes like replacing string.Equals(a, b, StringComparison.CurrentCultureIgnoreCase); with a.ToLower() == b.ToLower();).
I could provide you with the diff from these four commits if you'd like but it's going to be a big one.

Our setup (that's been working for over a year now on ef core 2.*):

  • every application is dockerized separately
  • all applications run as dockerized web apps on azure

The issue is quite annoying and made us move back to windows apps on azure (where everything works just as it did before ef core upgrade). Since our solution is huge, there is no possibility to make a small POC project. We went through all breaking changes a few times but didn't notice anything wrong. Could you point us in any direction here? Any hint, any place worth checking? Anything you need will be supplied.

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