-
Notifications
You must be signed in to change notification settings - Fork 43
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
NGSI-LD subscription constant crashes: "std::bad_alloc" #60
Comments
The ngsi-ld implementation is very much work-in-progress and likely to fail or crash. That said, I will look into this problem right now and see if I can see anything strange. Could you please tell me the response to a
Just to see the exact version you are using. About the subscription, I will do my tests with your exact request though to try to catch the error that you have seen. |
Hi, |
So, you have a very new version of orionld, that's great. About the crashes, "std::bad_alloc" indicates you are out of memory. Nothing we can do about a problem like that. I created a simple func-test, that simply creates the subscription and receives the About If this is a big problem for you (and others) we might open up an issue about it and eventually implement typePatterns. I don't know why this kind of patterns weren't included in the spec for ngsi-ld but I will find out and I will let you know. |
I added the functest, in case you want to use it:
I'm closing this issue. |
Hm, I had a look at the memory consumption as this was one of our first ideas. At the moment the server (VM) has only 4GB but I can easily increase it. Will test it tomorrow and give you an answer. |
Hm, I don't exactly know how to run the functional test. I can execute the script as I have the git repo checked out locally but the broker is running in a docker container. So I am not sure it the script is doing anything (I get 3 outputs all with failure 10). |
"Create the 'same' subscription twice": that's very important input. Testing it NOW ! :) |
So, there is definitely a bug. Will fix it so that is returns a 400 Bad Request (unless the spec says otherwise). Now, why are you trying to create the same subscription again? |
The broker now looks up a subscription before creating it. Now you don't have any other choice than to avoid trying to recreate the subscription ... Perhaps you could send me the logfile (still using the version of the broker that fails), starting the broker with all traces:
Like that, with some luck, I might be able to find the problem you are facing. [ Also, in case you are familiarized with valgrind, you could run the broker under valgrind and send me the report. that would be extremely valuable ] |
I changed to debug level with all traces. As the broker now doesn't crash immediately (there is a high CPU load, I think it will crash in days after finishing all the logs) I just attached a log from the beginning until it starts repeating all the lines. Seem like an infinite loop. orion_halfhalf.log.tar.gz Edit: I did the subscription again just because of testing. I did not receive anything and just played a bit too much with postman. In the real use case we won't have to constantly update the subscription and if we need to update we can DELETE and renew it (or PATCH if it is integrated sometime) |
It helps, of course it does :) However, now that I have an idea what to look for I will do my best to reproduce the error and fix it. Thank you very much for helping me to find an ugly bug ! |
Is this already implemented in the latest docker image? I still get the error. As the "GET" for active subscriptions is not implemented it is somehow impossible to proof for active subscriptions as my broker is still crashing instead of providing a bad request. |
It is implemented, just your broker seems to crash before it gets there ... |
Meanwhile, the output from valgrind for this crash would be really useful |
If you can provide some information on how to use it with the docker image I can test it. |
valgrind is included in the docker image, hopefully this will be finished today. So, I'd propose to get a new docker image and try again. We'd be able to do some serious debugging with valgrind. I will let you know when the new docker image is prepared |
The docker image should be OK now |
it works for me. closing |
Hi,
I am trying to get a subscription working for new added data sources. For this I add the following subscription:
{ "id": "urn:ngsi-ld:Subscription:testsubscription", "type": "Subscription", "entities": [ { "type": ".*" } ], "notification": { "format": "keyValues", "endpoint": { "uri": "http://callback_computer:8080/callback" } }, "@context": "https://fiware.github.io/NGSI-LD_TestSuite/ldContext/testFullContext.jsonld" }
From time to time I get a 201 header back with the subscription id as location. Besides the fact that I don't get any callback for new context (don't know why) the orion-ld server, provided as the latest docker image, constantly crashes.
When trying to add the subscription the connection seems to hang up. After a while (ca. 1 minute) the broker has crashed with a "std::bad_alloc" in its log.
Even if I am doing something wrong with the subscription a crash should not happen? Is there any help/tutorial showing ho to get a subscription working with NGSI-LD? I just found the test suite where I copied the subscription example and changed it to mine (as shown above).
Thanks and kind regards,
tank
The text was updated successfully, but these errors were encountered: