brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <>
Subject [GitHub] brooklyn-server pull request #681: Flag allowing a Winrm4jTool to use unique...
Date Tue, 16 May 2017 06:12:48 GMT
Github user neykov commented on a diff in the pull request:
    --- Diff: software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/winrm4j/
    @@ -237,7 +240,7 @@ private static synchronized WinRmClientContext createWinrmContext(ManagementCont
             // TODO Use getScratchpad()
             BrooklynProperties props = ((ManagementContextInternal)mgmt).getBrooklynProperties();
             WinRmClientContext instance = props.getConfig(CONTEXT);
    -        if (instance == null) {
    +        if (instance == null || Boolean.TRUE.equals(props.getConfig(USE_UNIQUE_CONTEXT)))
    --- End diff --
    This will cause buildup of connection pools & threads for them (pool per `executePs`
    Instead I suggest that we don't pass the `context` at all to `WinRmTool.Builder`. When
no `context` is passed externally, `WinRmClient` will create one and destroy it when done
with the request.
    The flag doesn't seem too useful since it causes incorrect behaviour when activated -
suggest doing the changes unconditionally.
    Longer term would be great if we implement caching like in `SshMachineLocation` as @aledsage
suggests, but with the addition of a `release` step so we can terminate the `context` when
no longer needed.

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