jenkins-bot has submitted this change and it was merged.

Change subject: Don't use `process.exit` on a normal successful exit.
......................................................................


Don't use `process.exit` on a normal successful exit.

The `process.exit` function completes abruptly and immediately, but
sometimes there is outstanding "stuff" which node still needs to do
(actually closing files, etc).  In theory this shouldn't matter, but
in practice it seems to: we occasionally end up with truncated files.

Change-Id: Id289c91cbc98ea9d0767498dbbc86b9df12b8523
---
M bin/mw-ocg-bundler
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Cscott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/bin/mw-ocg-bundler b/bin/mw-ocg-bundler
index b1eaf37..8bf1aa6 100755
--- a/bin/mw-ocg-bundler
+++ b/bin/mw-ocg-bundler
@@ -134,7 +134,15 @@
        });
 }).then(function(status) {
        Syslog.close();
-       process.exit(status);
+       if (status !== 0) {
+           // process.exit completes abruptly; sometimes there is
+           // outstanding "stuff" which node still needs to do
+           // (actually closing files, etc).  In theory this shouldn't
+           // matter, but in practice it does. :(  So don't call
+           // process.exit unless something seemed to have already
+           // gone wrong.
+           process.exit(status);
+       }
 });
 
 p.done(null, function(err) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id289c91cbc98ea9d0767498dbbc86b9df12b8523
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/bundler
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to