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

Keeps print log file if failed to call sinks, even after dropping the rule #266

Closed
jinfahua opened this issue May 15, 2020 · 1 comment · Fixed by #278
Closed

Keeps print log file if failed to call sinks, even after dropping the rule #266

jinfahua opened this issue May 15, 2020 · 1 comment · Fixed by #278
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jinfahua
Copy link
Collaborator

Take following steps to reproduce the problem.

  • Stream definition
create stream 'demo() WITH (FORMAT="JSON", DATASOURCE="devices/")'
  • Rule definition
{
  "sql": "SELECT * FROM demo",
  "actions": [
    {
      "log": {}
    },
    {
      "rest": {
        "url": "http://localhost:8888",
        "method": "Get",
        "dataTemplate": "{\"hello\": 3}",
        "sendSingle": true
      }
    }
  ]
}
  • Install & start EMQ Broker at localhost:1883
  • A web server listen at 8888 port, but server should return 404 if accessing the endpoint (to report an error when call rest sink)
  • Use any MQTT client tool to send a JSON message, such as {"temperature": 12, "humidity" : 15}
  • Following error message print in the log file
time="2020-05-15T09:02:42+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:02:43+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:02:44+08:00" level=info msg="save cache for rule rule1" file="sink_cache.go:126" rule=rule1
time="2020-05-15T09:02:44+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:02:45+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:02:46+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1

It still print these message even after the rule is drop, bin/cli drop rule rule1

time="2020-05-15T09:03:40+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:03:40+08:00" level=info msg="sink node sink_log instance 0 done" file="sink_node.go:185" rule=rule1
time="2020-05-15T09:03:40+08:00" level=info msg="unary operator preprocessor_demo instance 0 cancelling...." file="operations.go:153" rule=rule1
time="2020-05-15T09:03:40+08:00" level=info msg="unary operator preprocessor_demo instance 0 done, cancelling future items" file="operations.go:108" rule=rule1
time="2020-05-15T09:03:40+08:00" level=info msg="unary operator project instance 0 cancelling...." file="operations.go:153" rule=rule1
time="2020-05-15T09:03:40+08:00" level=info msg="unary operator project instance 0 done, cancelling future items" file="operations.go:108" rule=rule1
time="2020-05-15T09:03:40+08:00" level=info msg="source demo done" file="source_node.go:119" rule=rule1
time="2020-05-15T09:03:40+08:00" level=info msg="Mqtt Source instance 0 Done" file="mqtt_source.go:175" rule=rule1
time="2020-05-15T09:03:41+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:03:42+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:03:43+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:03:44+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:03:45+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1
time="2020-05-15T09:03:46+08:00" level=warning msg="sink node sink_rest instance 0 publish {\"hello\": 3} error: rest sink fails to err http return code: 404." file="sink_node.go:272" rule=rule1

Any workaround for this? Yes, add retryInterval to avoid keeping trying to re-send the result.

{
  "sql": "SELECT * FROM demo",
  "actions": [
    {
      "log": {}
    },
    {
      "rest": {
        "url": "http://localhost:9443",
        "method": "Get",
        "retryInterval": -1,
        "dataTemplate": "{\"hello\": 3}",
        "sendSingle": true
      }
    }
  ]
}
@jinfahua
Copy link
Collaborator Author

Fixed & close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants