uninterruptible 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/uninterruptible/binder.rb +9 -5
- data/lib/uninterruptible/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b45204189743c30326bd6e496b3c69c88d4383d5
|
4
|
+
data.tar.gz: c8d14b020356d5f68685b2f58833a433868cddb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c89bd5e1d9adadc4b3e31bf9b745f339599d158782d9eb6bd81d1e47c58f0f58d00469cb72566b2730baaf80222b6887acdf0dcdebf6c89c669a4e74624ed126
|
7
|
+
data.tar.gz: d78b97f691ed20d40f02730f6e3fcf866e1fb27218b3256187c4aec046819fe7279a0aaed86ba8088dbe0e8fc57b5463c4c7ef7617299fb581fd51de6e04f087
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.5.2
|
4
|
+
* Pass a class to UNIXSocket.recv_io to have the C-code instantiate our socket server. If we don't, they have a habit of getting garbage collected resulting in Errno:EBADF exceptions
|
5
|
+
|
3
6
|
## 2.5.1
|
4
7
|
* Fix bug where new restart code didn't work with TLS servers
|
5
8
|
* Add echo server tests for UNIX and TLS servers
|
@@ -35,7 +35,7 @@ module Uninterruptible
|
|
35
35
|
# @return [TCPServer] Socket server for the configured address and port
|
36
36
|
def bind_to_tcp_socket
|
37
37
|
if ENV[FILE_DESCRIPTOR_SERVER_VAR]
|
38
|
-
TCPServer
|
38
|
+
bind_from_file_descriptor_server(TCPServer)
|
39
39
|
else
|
40
40
|
TCPServer.new(bind_uri.host, bind_uri.port)
|
41
41
|
end
|
@@ -46,7 +46,7 @@ module Uninterruptible
|
|
46
46
|
# @return [UNIXServer] Socket server for the configured path
|
47
47
|
def bind_to_unix_socket
|
48
48
|
if ENV[FILE_DESCRIPTOR_SERVER_VAR]
|
49
|
-
UNIXServer
|
49
|
+
bind_from_file_descriptor_server(UNIXServer)
|
50
50
|
else
|
51
51
|
File.delete(bind_uri.path) if File.exist?(bind_uri.path)
|
52
52
|
UNIXServer.new(bind_uri.path)
|
@@ -70,11 +70,15 @@ module Uninterruptible
|
|
70
70
|
|
71
71
|
# Open a connection to a running FileDesciptorServer on the parent of this server and obtain a file descriptor
|
72
72
|
# for the running socket server on there.
|
73
|
-
|
73
|
+
#
|
74
|
+
# @param socket_klass [#for_fd] Class which responds to for_fd and accepts a file descriptor
|
75
|
+
#
|
76
|
+
# @return [IO] An IO instance created from the file descriptor received from the file descriptor server
|
77
|
+
def bind_from_file_descriptor_server(socket_klass)
|
74
78
|
fds_socket = UNIXSocket.new(ENV[FILE_DESCRIPTOR_SERVER_VAR])
|
75
|
-
socket_file_descriptor = fds_socket.recv_io
|
79
|
+
socket_file_descriptor = fds_socket.recv_io(socket_klass)
|
76
80
|
fds_socket.close
|
77
|
-
socket_file_descriptor
|
81
|
+
socket_file_descriptor
|
78
82
|
end
|
79
83
|
end
|
80
84
|
end
|