-
Notifications
You must be signed in to change notification settings - Fork 12
v0.6.8 proposal #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
v0.6.8 proposal #121
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>
belochub
approved these changes
Apr 3, 2017
Member
belochub
left a comment
There was a problem hiding this 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
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>
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Version 0.6.8 (2017-03-03, @aqrln)
This is a tiny semver-patch release.
Notable changes:
All changes: