This is a migrated thread and some comments may be shown as answers.

Simple retrieve fails every 1 out of 20 times

5 Answers 32 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Blake
Top achievements
Rank 1
Blake asked on 20 Jul 2013, 06:06 PM
I have a custom table in Everlive with about 8 records and no custom code on retrieve.  About 1 in every 20 retrieves fails with a timeout due to custom code.  Any ideas?

5 Answers, 1 is accepted

Sort by
0
Lyubomir Dokov
Telerik team
answered on 22 Jul 2013, 03:58 PM
Hello Blake,

We haven't encountered a similar issue. Do you have any cloud code on any content type in your app(even if different from the one you are requesting)? This should not be a problem, I am just trying to figure out what happens. Also, did you do any tests with cloud code for the type, or you have never used cloud code at all?

Thanks.

Regards,
Lyubomir Dokov
Telerik

Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Blake
Top achievements
Rank 1
answered on 22 Jul 2013, 04:06 PM
Lyubomir,

I do have cloud code on the same content type (MenuItemRatings) but only for create and update, nothing on read.  See attached.  I tested the cloud code and it works as expected when creating and updating.

Retrieving works ok too, it just times out randomly sometimes and it is the only content type I have issues with timing out.

Thanks,
Blake
0
Lyubomir Dokov
Telerik team
answered on 24 Jul 2013, 12:33 PM
Hello Blake,

Your code looks fine. However, there is one thing you should adjust. You are registering many event handlers that do nothing. It is best to remove all those handlers that only have "done()". This will speed up your requests.

We currently have no way of finding out if you actually do some work in the handler. If you register a handler for, say, READ events, we process the code for all READ requests, even if it only returns(calls done() ). If you remove the unnecessary handlers your requests will never even reach the custom code processing module.

While the above should not be a cause for your problem, it will most likely fix it. We will use the exact code you gave us and investigate further.


Regards,
Lyubomir Dokov
Telerik

Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Blake
Top achievements
Rank 1
answered on 24 Jul 2013, 01:09 PM
Lyubomir,

Thanks, this is helpful information.  I will test it out.

It appears that when you go into Cloud Code for a content type, then it has empty handlers using "done()" defined for each request.  I'd suggest maybe commenting out all the handlers so people can use them as reference.

Thanks!
Blake
0
Lyubomir Dokov
Telerik team
answered on 24 Jul 2013, 01:32 PM
Hello,

You are right, we should think about how to make this more clear.

When you create a content type there is no cloud code associated with it. We show a default snippet to allow customers to get started quickly, but it is not stored anywhere. It gets stored and associated with the content type only after you click the Save button.

Once we have some cloud code, we store which event handlers are defined there and we execute the cloud code module only for those events. So, for example, if only beforeRead and afterCreate are defined, we will not invoke the cloud code module for DELETE and UPDATE requests, only for CREATE and READ. Thus, it is better to have nothing, than to have an empty handler.

Hope this makes sense.


Regards,
Lyubomir Dokov
Telerik

Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Tags
General Discussion
Asked by
Blake
Top achievements
Rank 1
Answers by
Lyubomir Dokov
Telerik team
Blake
Top achievements
Rank 1
Share this question
or