-
Notifications
You must be signed in to change notification settings - Fork 78
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
Spark.function() args > 63 chars knocks Core offline briefly #30
Comments
The cause of the drop-off the cloud is this check here: https://github.com/spark/core-communication-lib/blob/master/src/spark_protocol.cpp#L887-L890 If the function argument passed is longer than the limit - currently 63 characters then return false. The function returns false on error (typically read/write error), which causes the caller to drop the device off the cloud. (Sets SPARK_CLOUD_SOCKETED=0, so the next iteration of the background loop, the cloud is reconnected.) So the question is, rather than dropping the cloud connection, is there a better response?
|
I think any response is better than dropping the cloud connection. Although between your first three options I don't have a strong preference |
I think ideally the device should return 'FunctionReturnError' to the cloud |
Since the only UI on the core is a blinky LED, and that might be in a box Bonus points for immediately including a cloud-reported ASSERT() and/or On Tue, Apr 14, 2015 at 10:05 AM, David Middlecamp <[email protected]
Andy |
Oh - and return some safe, non-pathological return value, and do not kick On Tue, Apr 14, 2015 at 10:10 AM, Andy Warner [email protected] wrote:
Andy |
The Spark.log() proposal addresses communicating errors to the cloud, so that would be put to good use here. |
+1 On Tue, Apr 14, 2015 at 10:37 AM, Matthew McGowan [email protected]
Andy |
Although we might want to partition categories of logs (think syslog, but Note that this also flips into fleet management - anything that suggests On Tue, Apr 14, 2015 at 10:47 AM, Andy Warner [email protected] wrote:
Andy |
Yep to all of that. afaik that's the direction we're heading. api errors will be distinct from other logs. |
+10^6 On Tue, Apr 14, 2015 at 10:55 AM, Matthew McGowan [email protected]
Andy |
Tried with 0.3.4 and the latest and greatest HAL firmware and the Core is doing the same thing, dropping off the cloud for a good 1 second count if I throw more than 63 chars at the API for Spark.function()
@dmiddlecamp has confirmed no hard limit for this one in the API, so it sounds like the limit must be causing this response at the firmware level.
It seems like a hard coded limit in the API would be good:
Pros:
Cons:
I also think the firmware should have a hard coded limit that keeps it operating sanely.
The text was updated successfully, but these errors were encountered: