message_bus 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of message_bus might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/message_bus/version.rb +1 -1
- data/lib/message_bus.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f42e4714f39aecb865965bb91a089a5bcd7a8670
|
4
|
+
data.tar.gz: ab929f4b40c6ea23d6f680392da942234ec02457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04ea180a321eb637807bc14bf657706a1cc66073043f41d915788fe74e8fe7590d80d1dfaddcbea24fe67639b10ff436638c5d6e21636183b93976e1589060a9
|
7
|
+
data.tar.gz: 92eac39422601a62401f9c2ff2386e1ce686194fce6ca67b88f9948bdddc0d60b001feba16a07cd503bad83ca0ebe1debb2253767243fc6dec6e500cb67226a7
|
data/CHANGELOG
CHANGED
data/lib/message_bus/version.rb
CHANGED
data/lib/message_bus.rb
CHANGED
@@ -412,10 +412,16 @@ module MessageBus::Implementation
|
|
412
412
|
end
|
413
413
|
end
|
414
414
|
|
415
|
+
# adjust for possible race condition
|
416
|
+
@last_message = Time.now
|
417
|
+
|
415
418
|
blk = proc do
|
416
|
-
if !@destroyed && thread.alive?
|
419
|
+
if !@destroyed && thread.alive? && keepalive_interval > MIN_KEEPALIVE
|
420
|
+
|
417
421
|
publish("/__mb_keepalive__/", Process.pid, user_ids: [-1])
|
418
|
-
|
422
|
+
# going for x3 keepalives missed for a restart, need to ensure this only very rarely happens
|
423
|
+
# note: after_fork will sort out a bad @last_message date, but thread will be dead anyway
|
424
|
+
if (Time.now - (@last_message || Time.now)) > keepalive_interval*3
|
419
425
|
MessageBus.logger.warn "Global messages on #{Process.pid} timed out, restarting process"
|
420
426
|
# No other clean way to remove this thread, its listening on a socket
|
421
427
|
# no data is arriving
|