Uploaded image for project: 'Trapperkeeper'
  1. Trapperkeeper
  2. TK-427

tk metrics closes request input stream before parsing request

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Systems Engineering
    • Story Points:
      1
    • Sprint:
      SE 2017-01-11
    • QA Risk Assessment:
      Needs Assessment

      Description

      Querying for many trapperkeeper metrics in bulk causes the below exception

      2016-12-14 16:40:56,546 WARN  [o.e.j.s.HttpChannel] /metrics/v1/mbeans
      java.io.IOException: Stream closed
              at java.io.BufferedReader.ensureOpen(BufferedReader.java:122)
              at java.io.BufferedReader.read(BufferedReader.java:278)
              at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.loadMore(ReaderBasedJsonParser.java:180)
              at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._skipAfterComma2(ReaderBasedJsonParser.java:2231)
              at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._skipComma(ReaderBasedJsonParser.java:2226)
              at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:632)
              at cheshire.parse$lazily_parse_array$fn__4967.invoke(parse.clj:53)
              at clojure.lang.LazySeq.sval(LazySeq.java:40)
              at clojure.lang.LazySeq.seq(LazySeq.java:49)
              at clojure.lang.RT.seq(RT.java:521)
              at clojure.core$seq__4357.invokeStatic(core.clj:137)
              at clojure.core$map$fn__4785.invoke(core.clj:2637)
              at clojure.lang.LazySeq.sval(LazySeq.java:40)
              at clojure.lang.LazySeq.seq(LazySeq.java:49)
              at clojure.lang.RT.seq(RT.java:521)
              at clojure.core$seq__4357.invokeStatic(core.clj:137)
              at clojure.core$seq__4357.invoke(core.clj:137)
              at cheshire.generate$generate.invokeStatic(generate.clj:132)
              at cheshire.generate$generate.invoke(generate.clj:116)
              at cheshire.core$generate_string.invokeStatic(core.clj:73)
              at cheshire.core$generate_string.invoke(core.clj:48)
              at puppetlabs.trapperkeeper.services.metrics.ringutils$json_response.invokeStatic(ringutils.clj:7)
              at puppetlabs.trapperkeeper.services.metrics.ringutils$json_response.invoke(ringutils.clj:5)
              at puppetlabs.trapperkeeper.services.metrics.metrics_core$build_handler$fn__41674$fn__41675.invoke(metrics_core.clj:104)
              at compojure.response$eval6981$fn__6982.invoke(response.clj:33)
              at compojure.response$eval6936$fn__6937$G__6927__6944.invoke(response.clj:6)
              at puppetlabs.trapperkeeper.services.metrics.metrics_core$build_handler$fn__41674.invoke(metrics_core.clj:96)
              at ring.middleware.keyword_params$wrap_keyword_params$fn__41226.invoke(keyword_params.clj:35)
              at ring.middleware.params$wrap_params$fn__30480.invoke(params.clj:64)
              at ring.middleware.absolute_redirects$wrap_absolute_redirects$fn__41464.invoke(absolute_redirects.clj:38)
              at ring.middleware.content_type$wrap_content_type$fn__31383.invoke(content_type.clj:30)
              at ring.middleware.default_charset$wrap_default_charset$fn__41439.invoke(default_charset.clj:26)
              at ring.middleware.not_modified$wrap_not_modified$fn__31412.invoke(not_modified.clj:52)
              at bidi.ring$eval31490$fn__31491.invoke(ring.clj:21)
              at bidi.ring$eval31469$fn__31470$G__31460__31479.invoke(ring.clj:12)
              at puppetlabs.comidi$make_handler$fn__33034.invoke(comidi.clj:249)
              at puppetlabs.trapperkeeper.services.webserver.jetty9_core$ring_handler$fn__39148.invoke(jetty9_core.clj:424)
              at puppetlabs.trapperkeeper.services.webserver.jetty9_core.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)
      

      Which is due to the stream being closed before cheshire has been able to parse all of the request. This is due to the payload being a JSON array and cheshire returning a lazy-seq

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  ryan.senior Ryan Senior
                  Reporter:
                  ryan.senior Ryan Senior
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: