Aled Sage created BROOKLYN-383:
----------------------------------
Summary: REST api serialization of sensor value that is a Task can
cause StackOveflowError
Key: BROOKLYN-383
URL: https://issues.apache.org/jira/browse/BROOKLYN-383
Project: Brooklyn
Issue Type: Bug
Reporter: Aled Sage
Priority: Minor
In Brooklyn 0.10.0-SNAPSHOT...
If a sensor value is set to be the value of an uncompleted {{Task}}, and then
that sensor value is retrieved over json, it causes problems!
For example, if it is an effector task, we can get the warning below (with 600K
characters on that log line!):
{noformat}
2016-11-10 11:41:30,059 WARN o.a.b.u.c.j.ErrorAndToStringUnknownTypeSerializer
[qtp1382493-13]: Standard serialization not possible for class
org.apache.brooklyn.util.core.task.DynamicSequentialTask
(Task[sleepEffector]@dTJS4pKS)
com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion
(StackOverflowError) (through reference chain:
...
{noformat}
For other simpler in-progress tasks, it tries to serialize everything reachable
from the task (so we get 251K of serialized state!).
We should not try to serialize tasks. Instead, we should return a simpler json
object that tells us it is a task, gives us the id, and the task's display name.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)