Skip to content

Rfc2898DeriveBytes.Pbkdf2 holding threads #112898

Open
@ecrocombe

Description

@ecrocombe

Description

Using Npgsql with EfCore locks up application, with pretty much all active threads held by System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2, with the remaining active threads working on logging timeouts.

Reproduction Steps

This is something that is intermittent, and I'm unsure of the reproduction steps precisely, but i'll have a go:

  1. Build dotnet application with EfCore DbContextPool, using Postgres Data Provider.
  2. Run application anywhere from 1 to 10 hours witnessing 3% CPU usage on average and around 1,400 queries p/second
  3. Experience application lock up, with 6400% CPU usage (Dual CPU server with 64 cores in total).

Sorry i cannot be more specific on this.

Expected behavior

Application to perform whatever task is in Rfc2898DeriveBytes.Pbkdf2 at a reasonable time.

Actual behavior

Rfc2898DeriveBytes.Pbkdf2 either does not return or returns after it has read the newspaper and had its coffee.

Regression?

We have had this issue for a long time (couple of months) and only just now cracking down the source of it to here.

Known Workarounds

None Known. Currently moved to a different authentication scheme which does not utilize Rfc2898DeriveBytes.Pbkdf2 at all.

Configuration

Docker configuration: Swarm
Runtime Docker image: mcr.microsoft.com/dotnet/runtime:9.0-alpine
Build Docker image: mcr.microsoft.com/dotnet/sdk:9.0-alpine
Docker Image additional packages (apk add): openssl icu-libs icu-data-full tzdata fontconfig ttf-dejavu mtr
Architecture: linux-musl-x64

Other information

Original issue created in Npgsql repo npgsql/npgsql#6029

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Securityneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsideration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions