brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <>
Subject [GitHub] brooklyn-server issue #491: (WIP) execAsync parameter for SshMachineLocation...
Date Tue, 10 Jan 2017 17:36:11 GMT
Github user aledsage commented on the issue:
    I started looking into why `testSshExecScript()` was failing. First quick comment: you
need to enable the feature:
        public void setUp() throws Exception {
            origAsyncExecEnablement = BrooklynFeatureEnablement.setEnablement(BrooklynFeatureEnablement.FEATURE_SSH_ASYNC_EXEC,
        public void tearDown() throws Exception {
            try {
            } finally {
                if (origAsyncExecEnablement != null) {
                    origAsyncExecEnablement = null;
    But it still fails. It doesn't manage to get the stdout/stderr from the long polling.
If you change the test to also pass in `SshMachineLocation.NO_STDOUT_LOGGING.getName(), true`
then it works.
    The problems seems to be the interaction between the `PipedOutputStream` (added in `ExecWithLoggingHelpers.execWithLogging()`)
and the `CountingOutputStream` (added in `SshjTool.execScriptAsyncAndPoll`'s `longPoll()`).
    I don't have time to investigate further just now, unfortunately. I suggest we park this
for a bit longer.
    I'm not sure why we're wrapping it in a `PipedOutputStream` (which allows us to also receive
the bytes and log them, using the `StreamGobbler` to respond to callbacks about the bytes
being received). I'm not sure why we don't just wrap the `OutputStream` in a much simpler
way, in a similar way to how guava wraps `CountingOutputStream` - where on each byte that
is written it can check if that's the end of a line and log it accordingly.
    But we don't want to be making changing like that just now, and certainly not as part
of this PR.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message