Subramanya Sastry has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/169200

Change subject: Revert "fixup! Send done on error too"
......................................................................

Revert "fixup! Send done on error too"

This reverts commit b24cae8200e9c660cae14d3ed8fa239c20a40441.

Reverting this so we can revert the cpu timeout patch as well. There is a fix 
for the timeout handling, but it is too soon for today's deploy.

Change-Id: I58df16a9d53053fd70148353d1b24d0ea47597d2
---
M api/routes.js
M api/server.js
2 files changed, 5 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/00/169200/1

diff --git a/api/routes.js b/api/routes.js
index 54c21a3..b6360c4 100644
--- a/api/routes.js
+++ b/api/routes.js
@@ -45,16 +45,13 @@
                        type: "timeout",
                        timeout: CPU_TIMEOUT
                });
-               var self = this;
-               function done(cb) {
+               p.then( function() {
                        process.send({
                                type: "timeout",
                                done: true
                        });
-                       var args = Array.prototype.slice.call(arguments, 1);
-                       cb.apply(self, args);
-               }
-               p.then( done.bind(null, resolve), done.bind(null, reject) );
+                       resolve.apply(this, arguments);
+               }, reject );
        });
 };
 
diff --git a/api/server.js b/api/server.js
index 733eebd..66b9b99 100755
--- a/api/server.js
+++ b/api/server.js
@@ -68,10 +68,8 @@
                if ( pid ) {
                        timeouts.delete( pid );
                }
-               if ( Object.keys(cluster.workers).length < argv.n ) {
-                       var worker = cluster.fork();
-                       worker.on('message', timeoutHandler.bind(null, worker));
-               }
+               var worker = cluster.fork();
+               worker.on('message', timeoutHandler.bind(null, worker));
        };
 
        // Kill cpu hogs

-- 
To view, visit https://gerrit.wikimedia.org/r/169200
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58df16a9d53053fd70148353d1b24d0ea47597d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to