Skip to content

Conversation

@aqrln
Copy link
Member

@aqrln aqrln commented Apr 3, 2017

Version 0.6.8 (2017-03-03, @aqrln)

This is a tiny semver-patch release.

Notable changes:

  • client: handle errors in connectAndInspect (Alexey Orlenko) #106

All changes:

  • client: handle errors in connectAndInspect (Alexey Orlenko) #106
  • src: fix incorrect indentation in CodePointToUtf8 (Alexey Orlenko) #103
  • test: add Node.js 7.8 to .travis.yml (Alexey Orlenko) #119

aqrln added 4 commits April 3, 2017 21:16
This is a backport of d8ba3fe.

As `DataCollector` always returns the data it managed to collect
successfully and passes errors as a separate object, `connectAndInspect`
has put errors as `_errors` property of the result to be consistent.
This was a horrible design decision that was counter-intuitive and would
only lead to the lack of proper error handling in application code (and
has actually led in our integration test).

Worse than that, even this `_errors` property would never have been
populated with errors because of a bug in `connectAndInspect`.  A patch
for the bug (just in case we ever want to backport it):

diff --git a/lib/client.js b/lib/client.js
index 83236d9..b0436fd 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -124,7 +124,7 @@ Client.prototype.connectAndInspect = function(
       interfaces.forEach((interfaceName) => {
         connection.inspectInterface(interfaceName, (error, appInterface) => {
           if (error) {
-            appInterface = null;
+            appInterface = error;
           }
           collector.collect(interfaceName, appInterface);
         });

The proper solution would have been to stop inspecting interfaces as
soon as the first error occurs and return it as the first argument of
the callback.  As it turned out, it was quite tricky to do with
DataCollector, and some other issues were found while inspecting
`metasync` sources too.  Fixing these problems requires
backwards-incompatible changes and will certainly happen in the next
semver-major release of `metasync`, but we need a quick fix here.  For
this reason, the function was refactored to use promises.

PR-URL: #106
Reviewed-by: Mykola Bilochub <nbelochub@gmail.com>
PR-URL: #103
Reviewed-by: Mykola Bilochub <nbelochub@gmail.com>
PR-URL: #119
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
@aqrln aqrln requested a review from belochub April 3, 2017 18:22
@aqrln aqrln added the release label Apr 3, 2017
Copy link
Member

@belochub belochub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This is a tiny semver-patch release.

Notable changes:

 * client: handle errors in connectAndInspect (Alexey Orlenko)

PR-URL: #121
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
@aqrln aqrln force-pushed the v0.6.8-proposal branch from 1e24342 to 882865c Compare April 3, 2017 18:30
@aqrln aqrln merged commit 882865c into v0.6 Apr 3, 2017
@aqrln aqrln deleted the v0.6.8-proposal branch April 3, 2017 19:33
aqrln added a commit that referenced this pull request Apr 3, 2017
This is a tiny semver-patch release.

Notable changes:

 * client: handle errors in connectAndInspect (Alexey Orlenko)

PR-URL: #121
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
aqrln added a commit that referenced this pull request Apr 3, 2017
belochub pushed a commit that referenced this pull request Jan 22, 2018
This is a tiny semver-patch release.

Notable changes:

 * client: handle errors in connectAndInspect (Alexey Orlenko)

PR-URL: #121
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
belochub pushed a commit that referenced this pull request Jan 22, 2018
This is a tiny semver-patch release.

Notable changes:

 * client: handle errors in connectAndInspect (Alexey Orlenko)

PR-URL: #121
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants