Skip to content

Investigate PostgreSQL shared memory exhaustion after repeated integration test runs #73

Description

@ValeraFinebits

Summary

After several integration test runs, BTCPayServer startup begins failing with:

SqlState 53100: could not resize shared memory segment ... No space left on device

Because of this, tests time out before payjoin logic is reached.

Observed in

Example failing test:

  • RunTestPaymentIntegrationTests.CreateInvoiceAndPayItThroughRunTestPayment

Failure point:

  • PayjoinAccountTestHelper.CreateInitializedTestContextAsync()
  • tester.StartAsync().WaitAsync(cancellationToken)

Logs show:

  • repeated migration retries
  • BTCPayServer.Hosting.MigrationStartupTask: Error while running migration scripts, retrying...
  • Npgsql.PostgresException 53100

Why investigate

It is not yet clear whether this is:

  • leaked test resources / bad cleanup,
  • container or PostgreSQL shared memory exhaustion,
  • or something that could also matter in production.

Expected behavior

Repeated test runs should not exhaust resources or break startup.

Acceptance criteria

  • identify root cause;
  • determine whether this is test-only or production-relevant;
  • define a reliable fix or mitigation;
  • confirm repeated test runs no longer trigger the issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions