From d3f9f4e8a7e4cac4fdce18c8b2ee701995388927 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Mon, 9 Nov 2015 21:35:03 +0000 Subject: [PATCH] keep track of queue length; omit some messages from entering the queue (pong,..) --- .../app/server/redispubsub.coffee | 17 +++++++++++------ bigbluebutton-html5/app/server/server.coffee | 12 +++++++++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/bigbluebutton-html5/app/server/redispubsub.coffee b/bigbluebutton-html5/app/server/redispubsub.coffee index a2f995afbb..8e33aa1a6b 100755 --- a/bigbluebutton-html5/app/server/redispubsub.coffee +++ b/bigbluebutton-html5/app/server/redispubsub.coffee @@ -53,14 +53,19 @@ class Meteor.RedisPubSub _Q: (pattern, channel, jsonMsg) => message = JSON.parse(jsonMsg) eventName = message.header.name - console.log "Q #{eventName} #{Meteor.myQueue.total()}" + messagesWeIgnore = [ + "BbbPubSubPongMessage" + "bbb_apps_is_alive_message" + ] - Meteor.myQueue.add({ - pattern: pattern - channel: channel - jsonMsg: jsonMsg - }) + unless eventName in messagesWeIgnore + console.log "Q #{eventName} #{Meteor.myQueue.total()}" + Meteor.myQueue.add({ + pattern: pattern + channel: channel + jsonMsg: jsonMsg + }) _onMessage: (pattern, channel, jsonMsg) => # TODO: this has to be in a try/catch block, otherwise the server will diff --git a/bigbluebutton-html5/app/server/server.coffee b/bigbluebutton-html5/app/server/server.coffee index 74d90ec536..0bde8ebb07 100755 --- a/bigbluebutton-html5/app/server/server.coffee +++ b/bigbluebutton-html5/app/server/server.coffee @@ -26,10 +26,18 @@ Meteor.startup -> Meteor.log.error "got a failure on taskHandler #{eventName} #{failures}" else handleRedisMessage(data, ()-> - Meteor.log.error "in callback after handleRedisMessage #{eventName}" + length = Meteor.myQueue.length() + lengthString = -> + if length>0 + "In the queue we have #{length} event(s) to process." + else "" + + Meteor.log.info "in callback after handleRedisMessage #{eventName}. + #{lengthString()}" next() ) + # To ensure that we process the redis json event messages serially we use a # callback. This callback is to be called when the Meteor collection is # updated with the information coming in the payload of the json message. The @@ -153,8 +161,6 @@ Meteor.startup -> # only process if requester is nodeJSapp means only process in the case when # we explicitly request the users else if eventName is 'get_users_reply' and message.payload.requester_id is 'nodeJSapp' - - Meteor.log.error JSON.stringify(message) if !Meteor.Meetings.findOne({meetingId: meetingId})? #TODO consider removing this cond users = message.payload.users