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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1ac114fd681f0af69bcfd05337dfbe4d01a7ec5
4
- data.tar.gz: 8dccb7dcc0e2cfda466c3c86ab457c874e4c181c
3
+ metadata.gz: f42e4714f39aecb865965bb91a089a5bcd7a8670
4
+ data.tar.gz: ab929f4b40c6ea23d6f680392da942234ec02457
5
5
  SHA512:
6
- metadata.gz: 19e87e3c06a0044ca70161484aa0f121ee5fe2a99cbda8edf6bcecaf87258e8e6e68b2b1983073e8430c881a8b8df6f186b7cfa1e0218dfa0350784c44cdbbcc
7
- data.tar.gz: 23baa4e52b0dd3f660c7b0fdca2055571735d7d09a794ec84bf83fe8ad046f3ecaefff6db002a46cf9036e6d7ef6a601d9596eb7b7bb22b77389567f027bdf47
6
+ metadata.gz: 04ea180a321eb637807bc14bf657706a1cc66073043f41d915788fe74e8fe7590d80d1dfaddcbea24fe67639b10ff436638c5d6e21636183b93976e1589060a9
7
+ data.tar.gz: 92eac39422601a62401f9c2ff2386e1ce686194fce6ca67b88f9948bdddc0d60b001feba16a07cd503bad83ca0ebe1debb2253767243fc6dec6e500cb67226a7
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 09-07-2015
2
+ - Version 1.0.16
3
+ - Fix: correct edge cases around keepalive checks on bus
4
+
1
5
  09-07-2015
2
6
  - Version 1.0.15
3
7
  - Feature: MessageBus.reliable_pub_sub.max_backlog_age (in secs) configurable (default to 7 days)
@@ -1,3 +1,3 @@
1
1
  module MessageBus
2
- VERSION = "1.0.15"
2
+ VERSION = "1.0.16"
3
3
  end
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
- if (Time.now - (@last_message || Time.now)) > keepalive_interval*2
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message_bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron