rookout 0.1.26 → 0.1.27

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
  SHA256:
3
- metadata.gz: 71a48ffc9af42b9e823c1bb8511514e95954425a6ff43495b0f90f7defc98f9c
4
- data.tar.gz: a525931c98fc3f8d23068f7d774a18c1b33b2edb756a1abea72a07efe8f2bef6
3
+ metadata.gz: 29081116b19d38b4ff177eb1355605b69c735aa29cfe4b883d05099fe3556a5b
4
+ data.tar.gz: e39b5d4e540c790d194aea231ddf33a4d2743fa67ce2b42c2043c561e569873c
5
5
  SHA512:
6
- metadata.gz: b7fac6cf5a613e6dc45c6071d5c6f6e133568911fa1ee6a66e17e50e22c61523dcd0706c1126ea8390320137e44ca832cb78946c4c57c2608fee0b4d590755b2
7
- data.tar.gz: baad1dcec8ec04456aeb993825e36b5025d9c901aaf56970709b51801b55e397f25be02e14153a31978433f8127576e02484af4cdfcb4f34229a22463524669a
6
+ metadata.gz: 1cc4883a3543f2c6026e7c739662ab8a2ca418bad4b9335a285b7bc1b45e2c30ff63359bcd6ebd4b2a490a72dbacd9b8500b7656a343ac5ddf6d8217fbf63e2e
7
+ data.tar.gz: 0dffd5e418e7f81f467b1667df7370806458de425e9b2998991798226bbe7ee9367bf639b15c30b53244aa6c3dae0dc7616dd97cce70beef65ac2429cf877109
@@ -25,7 +25,7 @@ module Rookout
25
25
 
26
26
  attr_reader :pending_messages
27
27
 
28
- def initialize output, agent_host, agent_port, proxy, token, labels
28
+ def initialize output, agent_host, agent_port, proxy, token, labels, print_on_connect
29
29
  agent_host_with_protocl = agent_host.include?("://") ? agent_host : "ws://#{agent_host}"
30
30
  @uri = "#{agent_host_with_protocl}:#{agent_port}/v1"
31
31
  if proxy.nil? || proxy.empty?
@@ -48,6 +48,8 @@ module Rookout
48
48
  @running = false
49
49
  @ready_event = Concurrent::Event.new
50
50
  once("Com::Rookout::InitialAugsCommand") { @ready_event.set }
51
+
52
+ @print_on_initial_connection = print_on_connect
51
53
  end
52
54
 
53
55
  def add message
@@ -101,6 +103,7 @@ module Rookout
101
103
 
102
104
  private
103
105
 
106
+ # rubocop:disable Style/StderrPuts
104
107
  def connection_thread
105
108
  backoff = Backoff.new
106
109
 
@@ -108,6 +111,10 @@ module Rookout
108
111
  begin
109
112
  client = open_new_connection
110
113
 
114
+ if @print_on_initial_connection
115
+ @print_on_initial_connection = false
116
+ STDERR.puts "[Rookout] Successfully connected to controller"
117
+ end
111
118
  Logger.instance.debug "WebSocket connected successfully"
112
119
  Logger.instance.info "Finished initialization"
113
120
 
@@ -128,6 +135,7 @@ module Rookout
128
135
  Logger.instance.debug "Reconnecting"
129
136
  end
130
137
  end
138
+ # rubocop:enable Style/StderrPuts
131
139
 
132
140
  def open_new_connection
133
141
  client = WebsocketClient.new @uri, @proxy, @token
@@ -17,7 +17,7 @@ module Rookout
17
17
  @labels["rookout_debug"] = "on" if Config.debug
18
18
 
19
19
  k8_namespace = create_cluster_namespace k8s_file_path
20
- unless k8_namespace == ""
20
+ unless k8_namespace == "" || @labels.key?("k8s_namespace")
21
21
  @labels["k8s_namespace"] = k8_namespace
22
22
  end
23
23
 
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- COMMIT = "5dbaa8024d9dd61fbf97ca654094c5c30728d4f9".freeze
2
+ COMMIT = "25edb2f6d66577295d8ee34842e067d6ad046d12".freeze
3
3
  end
@@ -32,6 +32,7 @@ module Rookout
32
32
  configure options
33
33
 
34
34
  rook = RookoutSingleton.instance
35
+ @start_options[throw_errors: throw_errors]
35
36
  rook.connect(**@start_options)
36
37
  rescue LoadError
37
38
  raise if throw_errors
@@ -40,7 +40,8 @@ module Rookout
40
40
  @services_started = false
41
41
  end
42
42
 
43
- def connect token: nil, host: nil, port: nil, proxy: nil, labels: [], async_start: false, fork: false
43
+ def connect token: nil, host: nil, port: nil, proxy: nil, labels: [], async_start: false, fork: false,
44
+ throw_errors: false
44
45
  raise Exceptions::RookInterfaceException, "Multiple connection attempts not supported!" unless @agent_com.nil?
45
46
 
46
47
  if fork
@@ -52,7 +53,7 @@ module Rookout
52
53
 
53
54
  Logger.instance.debug "Initiating AgentCom-\t#{host}:#{port}"
54
55
 
55
- @agent_com = ComWs::AgentComWs.new @output, host, port, proxy, token, labels
56
+ @agent_com = ComWs::AgentComWs.new @output, host, port, proxy, token, labels, !throw_errors
56
57
  @output.agent_com = @agent_com
57
58
  @command_handler = ComWs::CommandHandler.new @agent_com, @aug_manager
58
59
 
@@ -18,6 +18,7 @@ module Rookout
18
18
  def initialize tracer
19
19
  @tracer = tracer
20
20
  @augs = {}
21
+ @augs_lock = Mutex.new
21
22
  @iseqs = []
22
23
  @trace_point = TracePoint.new :script_compiled do |tp|
23
24
  begin
@@ -41,7 +42,7 @@ module Rookout
41
42
  def add_aug location
42
43
  positions = evaluate_all_scripts_to_location location
43
44
  @tracer.add_breakpoint_aug positions, location unless positions.empty?
44
- @augs[location.id] = location
45
+ @augs_lock.synchronize { @augs[location.id] = location }
45
46
  end
46
47
 
47
48
  def remove_aug aug_id
@@ -73,11 +74,13 @@ module Rookout
73
74
  filename = iseq.absolute_path
74
75
  return if filename.nil?
75
76
 
76
- @augs.each_value do |location|
77
- position = evaluate_script_to_location iseq, filename, location
78
- next if position.nil?
77
+ @augs_lock.synchronize do
78
+ @augs.each_value do |location|
79
+ position = evaluate_script_to_location iseq, filename, location
80
+ next if position.nil?
79
81
 
80
- @tracer.add_breakpoint_aug [position], location
82
+ @tracer.add_breakpoint_aug [position], location
83
+ end
81
84
  end
82
85
  end
83
86
 
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- VERSION = "0.1.26".freeze
2
+ VERSION = "0.1.27".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rookout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liran Haimovitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-14 00:00:00.000000000 Z
11
+ date: 2021-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller