Skip to content

Commit 55d2ab6

Browse files
committed
Terminate on error in message processing
since we do not know ho to restart yet minor updates in logging and comments
1 parent 363e7b8 commit 55d2ab6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/concurrent/actress/core.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def initialize(opts = {}, &block)
4848
@actress.send :initialize_core, self
4949
rescue => ex
5050
puts "#{ex} (#{ex.class})\n#{ex.backtrace.join("\n")}"
51-
terminate! # TODO test that this is ok
51+
terminate! # TODO test this
5252
end
5353
end
5454
end
@@ -105,6 +105,7 @@ def terminated?
105105
def terminate!
106106
guard!
107107
@terminated.set
108+
108109
parent_core.remove_child reference if parent_core
109110
@mailbox.each do |envelope|
110111
reject_envelope envelope
@@ -143,7 +144,7 @@ def receive_envelope
143144

144145
if terminated?
145146
reject_envelope envelope
146-
puts "this should not happen"
147+
logger.fatal "this should not be happening #{caller[0]}"
147148
end
148149

149150
logger.debug "received #{envelope.message} from #{envelope.sender_path}"
@@ -153,6 +154,7 @@ def receive_envelope
153154
rescue => error
154155
logger.error error
155156
envelope.ivar.fail error unless envelope.ivar.nil?
157+
terminate!
156158
ensure
157159
@receive_envelope_scheduled = false
158160
process_envelopes?

0 commit comments

Comments
 (0)