skylight 0.3.0.rc.5 → 0.3.0.rc.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/checksums.yml +2 -2
- data/ext/extconf.rb +2 -1
- data/lib/skylight/normalizers/process_action.rb +3 -1
- data/lib/skylight/version.rb +1 -1
- data/lib/skylight/worker/server.rb +1 -1
- data/lib/sql_lexer/lexer.rb +2 -2
- data/lib/sql_lexer/version.rb +1 -1
- data/too-many-sockets.md +62 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f6a3addbdf4a8213bc76ea6430030ab9ff2925f
|
4
|
+
data.tar.gz: 6e7ed7c562fce41983579e0fbb3d619ef742dac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c596d66b61b7c9a36dfd60d3e95fb549daaa8a7d5db6307e79892dd0b62d3b8692f0bb511872265afd7ad8e65f172d3f1140561fa98fae0dc07478e4f2e9c502
|
7
|
+
data.tar.gz: 150660085cfd209fc249ebadde9b46cc9707aed19651ae72e0c712b51fc70552f15871dd880a7eafb4ea4c1c5ce2444acbc0c6f062e6aad56f59c0ca1fe0ce87
|
data/ext/checksums.yml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
2
|
+
x86_64-linux: "4f0b9ef0d700d2da590ad0994c2067304a50d7b290f70353c394e4a040cdf0a5"
|
3
|
+
i686-linux : "9b7beebe61ef3201f4d7ad2cf5e92dc69cedefda033b9d081384c71700927a37"
|
data/ext/extconf.rb
CHANGED
@@ -47,7 +47,7 @@ unless File.exist?("libskylight.a")
|
|
47
47
|
end
|
48
48
|
|
49
49
|
unless missing_a
|
50
|
-
expected_checksum = checksums[
|
50
|
+
expected_checksum = checksums[arch]
|
51
51
|
actual_checksum = Digest::SHA2.hexdigest(archive)
|
52
52
|
|
53
53
|
if expected_checksum == actual_checksum
|
@@ -77,6 +77,7 @@ else
|
|
77
77
|
|
78
78
|
find_library("skylight", "factory", ".")
|
79
79
|
|
80
|
+
$CFLAGS << " -Werror"
|
80
81
|
if RbConfig::CONFIG["arch"] =~ /darwin(\d+)?/
|
81
82
|
$LDFLAGS << " -lpthread"
|
82
83
|
else
|
data/lib/skylight/version.rb
CHANGED
data/lib/sql_lexer/lexer.rb
CHANGED
@@ -26,7 +26,7 @@ module SqlLexer
|
|
26
26
|
|
27
27
|
StartQuotedID = %Q<">
|
28
28
|
StartTickedID = %Q<`>
|
29
|
-
StartString = %Q<'>
|
29
|
+
StartString = %Q<[a-zA-Z]?'>
|
30
30
|
StartDigit = %q<[\p{Digit}\.]>
|
31
31
|
|
32
32
|
StartSelect = %Q<SELECT(?=(?:[#{WS}]|#{OpPart}))>
|
@@ -50,7 +50,7 @@ module SqlLexer
|
|
50
50
|
Type = %Q<[#{StartID}][#{PartID}]*(?:\\(\d+\\)|\\[\\])?(?=#{AfterID})>
|
51
51
|
QuotedTable = %Q<#{TickedID}|#{QuotedID}>
|
52
52
|
|
53
|
-
StringBody = %q
|
53
|
+
StringBody = %q{(?:''|(?<!\x5C)(?:\x5C\x5C)*\x5C'|[^'])*}
|
54
54
|
String = %Q<#{StartString}#{StringBody}'>
|
55
55
|
|
56
56
|
Digits = %q<\p{Digit}+>
|
data/lib/sql_lexer/version.rb
CHANGED
data/too-many-sockets.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
We received a notification (Zendesk #280) from a customer that they were unable to SSH
|
2
|
+
into their box, and that their service provider discovered that Skylight
|
3
|
+
was triggering socket buffer limits.
|
4
|
+
|
5
|
+
The customer immediately disabled Skylight, which fixed the bug for him.
|
6
|
+
|
7
|
+
Customer Information:
|
8
|
+
|
9
|
+
* Using Skylight 0.2.3
|
10
|
+
* Ruby 2.0.0p353
|
11
|
+
* Also had New Relic installed (Bug #46)
|
12
|
+
* Recently upgraded to Rails 4
|
13
|
+
* Passenger Enterprise with a max-pool size of 12 and zero-downtime deploys
|
14
|
+
* He had a maxsockbuf of 32MB
|
15
|
+
|
16
|
+
The customer also reported 134 open sockets in the server process.
|
17
|
+
|
18
|
+
Separately, we discovered that New Relic was making our payloads
|
19
|
+
extremely large.
|
20
|
+
|
21
|
+
Our working hypothesis was that the large New Relic payloads were
|
22
|
+
triggering the max buffer condition, which was then cascading into more
|
23
|
+
failures.
|
24
|
+
|
25
|
+
Upon further investigation, we discovered a few things:
|
26
|
+
|
27
|
+
* If the client hits a kernel buffer limit (via EWOULDBLOCK that lasts
|
28
|
+
more than 5s), it closes down its socket
|
29
|
+
* The server expects to recover from this situation by getting the
|
30
|
+
client socket in its read list from IO.select. It would then try to
|
31
|
+
read from it, get an EOF, and close the socket.
|
32
|
+
* If the server does not get the client socket in its read list for some
|
33
|
+
(unknown) reason, this would result in an ever-growing list of sockets
|
34
|
+
on the server side.
|
35
|
+
|
36
|
+
We are not sure why the sockets would not appear in the read list, but
|
37
|
+
we hypothesize that when the OpenVZ limit is reached, the kernel no
|
38
|
+
longer includes the socket in the read list, causing the server to never
|
39
|
+
close the socket.
|
40
|
+
|
41
|
+
Mitigation strategies:
|
42
|
+
|
43
|
+
* The New Relic fix (#46) should reduce the likelihood of encountering
|
44
|
+
this in the first place
|
45
|
+
* We want to add a Hello heartbeat from the client. If the server
|
46
|
+
doesn't receive a message every 1m (or 2m, TBD), it will close the
|
47
|
+
socket even if it's not in the read list.
|
48
|
+
|
49
|
+
We are worried that if the server process ever gets stuck, this
|
50
|
+
condition can occur. We are also considering a server heartbeat back to
|
51
|
+
the clients, so they can take corrective action if the agent gets stuck.
|
52
|
+
|
53
|
+
Some mitigations for this situation:
|
54
|
+
|
55
|
+
* Kill the server process when a respawn is necessary. This will ensure
|
56
|
+
that a stuck agent process doesn't duplicate into N servers.
|
57
|
+
* Before connecting to the server socket, pre-check the server process
|
58
|
+
with kill -0.
|
59
|
+
|
60
|
+
For next time:
|
61
|
+
* Request skylight.log for easier debugging
|
62
|
+
* Form a best practices for customer bug reporting on doc site
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.0.rc.
|
4
|
+
version: 0.3.0.rc.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- lib/sql_lexer.rb
|
140
140
|
- lib/sql_lexer/lexer.rb
|
141
141
|
- lib/sql_lexer/version.rb
|
142
|
+
- too-many-sockets.md
|
142
143
|
homepage: http://www.skylight.io
|
143
144
|
licenses: []
|
144
145
|
metadata: {}
|