lib/bolt/executor.rb in bolt-2.23.0 vs lib/bolt/executor.rb in bolt-2.24.0
- old
+ new
@@ -54,15 +54,16 @@
end
end
@reported_transports = Set.new
@subscribers = {}
@publisher = Concurrent::SingleThreadExecutor.new
+ @publisher.post { Thread.current[:name] = 'event-publisher' }
@noop = noop
@run_as = nil
@pool = if concurrency > 0
- Concurrent::ThreadPoolExecutor.new(max_threads: concurrency)
+ Concurrent::ThreadPoolExecutor.new(name: 'exec', max_threads: concurrency)
else
Concurrent.global_immediate_executor
end
@logger.debug { "Started with #{concurrency} max thread(s)" }
@@ -123,10 +124,11 @@
h[target] = Concurrent::Promise.new(executor: :immediate)
end
# Pass this argument through to avoid retaining a reference to a
# local variable that will change on the next iteration of the loop.
@pool.post(batch_promises) do |result_promises|
+ Thread.current[:name] ||= Thread.current.name
results = yield transport, batch
Array(results).each do |result|
result_promises[result.target].set(result)
end
# NotImplementedError can be thrown if the transport is not implemented improperly
@@ -239,10 +241,10 @@
'value'
end
@analytics&.event('Plan', 'yaml', plan_steps: steps, return_type: return_type)
rescue StandardError => e
- @logger.debug { "Failed to submit analytics event: #{e.message}" }
+ @logger.trace { "Failed to submit analytics event: #{e.message}" }
end
def with_node_logging(description, batch)
@logger.info("#{description} on #{batch.map(&:safe_name)}")
result = yield