Simple retrieve fails every 1 out of 20 times

6 posts, 0 answers
  1. Blake
    Blake avatar
    9 posts
    Member since:
    May 2013

    Posted 20 Jul 2013 Link to this post

    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?
  2. Lyubomir Dokov
    Admin
    Lyubomir Dokov avatar
    43 posts

    Posted 22 Jul 2013 Link to this post

    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.
  3. Blake
    Blake avatar
    9 posts
    Member since:
    May 2013

    Posted 22 Jul 2013 Link to this post

    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
  4. Lyubomir Dokov
    Admin
    Lyubomir Dokov avatar
    43 posts

    Posted 24 Jul 2013 Link to this post

    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.
  5. Blake
    Blake avatar
    9 posts
    Member since:
    May 2013

    Posted 24 Jul 2013 Link to this post

    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
  6. Lyubomir Dokov
    Admin
    Lyubomir Dokov avatar
    43 posts

    Posted 24 Jul 2013 Link to this post

    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.
Back to Top