Ticket #5174 (closed bug: duplicate)

Opened 2 years ago

Last modified 2 years ago

Running out of OS threads in a server

Reported by: bos Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 6.12.3
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Runtime crash Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I have a web server that uses my mysql-simple package, and it dies after serving several hundred requests.

The mysql-simple package is a wrapper around the MySQL C API, which is unfortunately not signal-safe. GHC RTS signals kill it, so I've been using runInBoundThread to manage the signals from the Haskell world.

Unfortunately, the number of OS threads in flight increases with every use of runInBoundThread, so after a few hundred requests, I run out of OS threads (the default limit being 1024 threads on Linux), and my process is killed.

Change History

Changed 2 years ago by bos

By the way, I have a workaround for this bug, so it's non-urgent to me.

 https://github.com/mailrank/mysql/commit/72ebcccd64a9808dee5e66132930bf9c41b04dab

Changed 2 years ago by simonmar

  • status changed from new to closed
  • resolution set to duplicate

This should be fixed in 7.2.1; see #4262. Please test a 7.2.1 release candidate when we have one and let us know if you still have the problem.

Note: See TracTickets for help on using tickets.