Skip to content

Commit

Permalink
Fix: prax leaks file descriptors (quick fix)
Browse files Browse the repository at this point in the history
A Crystal bug generates a new libevent DNS base for every IPSocket.
This patch fixes it by forcing the correct memoization of the DNS
base.

See crystal-lang/crystal#1700 for details.
  • Loading branch information
ysbaddaden committed Oct 6, 2015
1 parent 82f5224 commit 3b91e60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/event.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Quick fix for https://github.com/manastech/crystal/issues/1700

module Event
struct Base
setter :dns_base
end
end

class Scheduler
@@eb.dns_base = @@eb.dns_base
end
1 change: 1 addition & 0 deletions src/prax.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require "signal"
require "logger"
require "option_parser"
require "./env"
require "./event"
require "./prax/config"
require "./prax/errors"
require "./prax/server"
Expand Down

0 comments on commit 3b91e60

Please sign in to comment.