Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passenger-status invalid JSON NaN values #1408

Closed
felixbuenemann opened this issue Mar 6, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@felixbuenemann
Copy link

commented Mar 6, 2015

The output from passenger-status --show=requests in v5.0.1 can contain invalid JSON, if values are NaN.

Example:

"turbocaching" : {
   "fetches" : 0,
   "hit_ratio" : nan,
   "hits" : 0,
   "store_success_ratio" : nan,
   "store_successes" : 0,
   "stores" : 0
}
…

Instead those nan values should be represented as null to comply with JSON.

Example JSON encoding using nodejs:

> JSON.stringify(NaN)
'null'
@felixbuenemann

This comment has been minimized.

Copy link
Author

commented Mar 6, 2015

This is probably better fixed by just guarding against division by zero.

@FooBarWidget

This comment has been minimized.

Copy link
Member

commented Mar 7, 2015

You're right. This is what our JSON library generates. I guess we should check for this.

@FooBarWidget FooBarWidget added this to the 5.0.3 milestone Mar 7, 2015

OnixGH pushed a commit that referenced this issue Mar 10, 2015

Daniel Knoppel (Phusion)

OnixGH pushed a commit that referenced this issue Mar 10, 2015

OnixGH pushed a commit that referenced this issue Mar 10, 2015

@OnixGH OnixGH closed this Mar 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.