Git Product home page Git Product logo

Comments (1)

yssk22 avatar yssk22 commented on July 22, 2024

ありがとうございます。

Error: This socket is closed
の例外が出力されます。

こちらですがNaNを書き込んだときに限らず、fluentd 側からソケットをcloseされたときにソケットの廃棄処理を正しくしてなかったので発生していた問題で修正しました。0.2.3 以降は修正されています。

NaNをログに書き込むと駄目というのは辛いのでNaNの
書き込みも許可してほしいです。

こちらですが、再現してみたところ

2013-03-23 16:51:34 +0900 fluent.warn: {"message":"emit transaction failed ","error":"'NaN' is an invalid number"}
2013-03-23 16:51:34 +0900 [warn]: emit transaction failed  error="'NaN' is an invalid number"
2013-03-23 16:51:34 +0900 [warn]: /Users/yssk22/.rvm/gems/ruby-1.9.3-p327/gems/yajl-ruby-1.1.0/lib/yajl.rb:72:in `encode'
2013-03-23 16:51:34 +0900 [warn]: /Users/yssk22/.rvm/gems/ruby-1.9.3-p327/gems/yajl-ruby-1.1.0/lib/yajl.rb:72:in `encode'
2013-03-23 16:51:34 +0900 [warn]: /Users/yssk22/.rvm/gems/ruby-1.9.3-p327/gems/yajl-ruby-1.1.0/lib/yajl.rb:22:in `dump'
2013-03-23 16:51:34 +0900 [warn]: /Users/yssk22/.rvm/gems/ruby-1.9.3-p327/gems/fluentd-0.10.32/lib/fluent/plugin/out_stdout.rb:27:in `block in emit'

のようになりました。これは、fluent-logger-node -> fluentd (in_forward) までの経路に問題はなく、out_stdout plugin (が使っているyajl-ruby 1.1.0)の問題のようです。

なお、NaN のとりあつかいですが、fluentd とのやりとりに利用できるJSONおよびmsgpackで実装上の違いがあるので、fluent-logger-node で特別に何かをすることはありません。

var msgpack = require('msgpack');
var a = {a : Number.NaN};
JSON.stringify(a);
'{"a":null}'
undefined
msgpack.unpack(msgpack.pack(a));
{ a: NaN }

from fluent-logger-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.