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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b72ea644f301ea7e25dde40d6f14ccc986e05211
4
- data.tar.gz: 89a4c7bd22804de66170f69ec5690c7ab1224ba5
3
+ metadata.gz: 0f6a3addbdf4a8213bc76ea6430030ab9ff2925f
4
+ data.tar.gz: 6e7ed7c562fce41983579e0fbb3d619ef742dac7
5
5
  SHA512:
6
- metadata.gz: 812242c812c7d018a903ca44e05969ddf4997caff99cc138fac6954a5ae461f254bfd66012d4735ea69cee84076aebd876ca3eec431dee8985f1064d4e33ace5
7
- data.tar.gz: 36363fc2011fc6f82b28a4eff8f8f45d95b5829bfd741ffcd9b86b009d4767b72e12391cc56653d7cde1c13054793a02bc4a32b520f592a145f75663e2441dbe
6
+ metadata.gz: c596d66b61b7c9a36dfd60d3e95fb549daaa8a7d5db6307e79892dd0b62d3b8692f0bb511872265afd7ad8e65f172d3f1140561fa98fae0dc07478e4f2e9c502
7
+ data.tar.gz: 150660085cfd209fc249ebadde9b46cc9707aed19651ae72e0c712b51fc70552f15871dd880a7eafb4ea4c1c5ce2444acbc0c6f062e6aad56f59c0ca1fe0ce87
@@ -1,3 +1,3 @@
1
1
  ---
2
- dc29745.x86_64-linux: "4f0b9ef0d700d2da590ad0994c2067304a50d7b290f70353c394e4a040cdf0a5"
3
- dc29745.i686-linux : "9b7beebe61ef3201f4d7ad2cf5e92dc69cedefda033b9d081384c71700927a37"
2
+ x86_64-linux: "4f0b9ef0d700d2da590ad0994c2067304a50d7b290f70353c394e4a040cdf0a5"
3
+ i686-linux : "9b7beebe61ef3201f4d7ad2cf5e92dc69cedefda033b9d081384c71700927a37"
@@ -47,7 +47,7 @@ unless File.exist?("libskylight.a")
47
47
  end
48
48
 
49
49
  unless missing_a
50
- expected_checksum = checksums["#{rust_version}.#{arch}"]
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
@@ -21,7 +21,9 @@ module Skylight
21
21
  normalized = {}
22
22
 
23
23
  PAYLOAD_KEYS.each do |key|
24
- normalized[key] = payload[key]
24
+ val = payload[key]
25
+ val = val.inspect unless val.is_a?(String) || val.is_a?(Numeric)
26
+ normalized[key] = val
25
27
  end
26
28
 
27
29
  normalized
@@ -1,4 +1,4 @@
1
1
  module Skylight
2
- VERSION = '0.3.0.rc.5'
2
+ VERSION = '0.3.0.rc.6'
3
3
  end
4
4
 
@@ -328,7 +328,7 @@ module Skylight
328
328
 
329
329
  def get_memory_usage
330
330
  `ps -o rss= -p #{Process.pid}`.to_i / 1024
331
- rescue Errno::ENOENT
331
+ rescue Errno::ENOENT, Errno::EINTR
332
332
  0
333
333
  end
334
334
  end
@@ -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<(?:''|\x5C'|[^'])*>
53
+ StringBody = %q{(?:''|(?<!\x5C)(?:\x5C\x5C)*\x5C'|[^'])*}
54
54
  String = %Q<#{StartString}#{StringBody}'>
55
55
 
56
56
  Digits = %q<\p{Digit}+>
@@ -1,3 +1,3 @@
1
1
  module SqlLexer
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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.5
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-18 00:00:00.000000000 Z
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: {}