Menu

#115 Return values for localcache fetch op backwards

closed-fixed
None
5
2009-03-12
2009-03-12
No

In r5294 a change was made to allow lcache_htable_fetch to return an additional code in the event of an error.

It returns -1 for error and 0 for not found. This is inconsistent with script functions should be returning and causes script to halt if a cache entry is not found.

Attached patch switches the values for error and notfound so the script doesn't exit incorrectly.

Discussion

  • Phil D'Amore

    Phil D'Amore - 2009-03-12

    Patch to reverse not found and error retvals

     
  • Anca Vamanu

    Anca Vamanu - 2009-03-12
    • assigned_to: nobody --> anca_vamanu
    • status: open --> closed-fixed
     
  • Anca Vamanu

    Anca Vamanu - 2009-03-12

    Hi Phil,

    Thank you for the report.
    I have changed that when I introduced MI commands forgeting that the core function cache_fetch returns the code from "lcache_htable_fetch" function.
    I have chosen to put -2 instead of 0 and not gone for your solution of putting 0 in case of error since I think it is better not to exit the script in any case.

    regards,
    Anca

     

Log in to post a comment.

MongoDB Logo MongoDB