You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by ahgittin <gi...@git.apache.org> on 2016/06/03 08:13:50 UTC

[GitHub] brooklyn-server pull request #180: prevent OOME on big streams and better lo...

GitHub user ahgittin opened a pull request:

    https://github.com/apache/brooklyn-server/pull/180

    prevent OOME on big streams and better logging for that case

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ahgittin/brooklyn-server oome-and-tidies

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/180.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #180
    
----
commit 17adc0b168fa09df71b882d46773ff6f642a70be
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date:   2016-06-03T08:13:11Z

    prevent OOME on big streams and better logging for that case

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #180: prevent OOME on big streams and better lo...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/180#discussion_r66537291
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/mgmt/BrooklynTaskTags.java ---
    @@ -190,9 +190,16 @@ protected WrappedStream(String streamType, ByteArrayOutputStream stream) {
             public Integer getStreamSize() {
                 return streamSize.get();
             }
    -        // there is a stream api so don't return everything unless explicitly requested!
    +        // there is a stream call on Activity REST api which accesses streamContent.get() directly;
    +        // so when serializing the tag, abbreviate things
             @JsonProperty("streamContents")
             public String getStreamContentsAbbreviated() {
    +            // TODO would be nice to just get the first 80 chars but that's a refactoring
    +            // which might affect persistence.  if stream is very large (100MB+) then we sometimes
    --- End diff --
    
    Agree we should be cautious about breaking persistence, so am happy to merge as-is. But would be really nice if we refactor in a safe way (e.g. keeping the old field, but changing the constructor args and adding a new field), so we can write something that gets the truncated data. (And in the future it could return it paginated, but not sure if that would be at all sensible?!).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #180: prevent OOME on big streams and better lo...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/180#discussion_r66538902
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/mgmt/BrooklynTaskTags.java ---
    @@ -190,9 +190,16 @@ protected WrappedStream(String streamType, ByteArrayOutputStream stream) {
             public Integer getStreamSize() {
                 return streamSize.get();
             }
    -        // there is a stream api so don't return everything unless explicitly requested!
    +        // there is a stream call on Activity REST api which accesses streamContent.get() directly;
    +        // so when serializing the tag, abbreviate things
             @JsonProperty("streamContents")
             public String getStreamContentsAbbreviated() {
    +            // TODO would be nice to just get the first 80 chars but that's a refactoring
    +            // which might affect persistence.  if stream is very large (100MB+) then we sometimes
    --- End diff --
    
    +1


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #180: prevent OOME on big streams and better logging f...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the issue:

    https://github.com/apache/brooklyn-server/pull/180
  
    LGTM; merging.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #180: prevent OOME on big streams and better lo...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/180


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---