Uploaded image for project: 'S2Graph'
  1. S2Graph
  2. S2GRAPH-230

ResourceManager onEvict cause segmentation fault with AnnoyModelFetcher

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: s2core
    • Labels:
      None

      Description

      Current implementation causes the segmentation fault when the query on edges that bind to custom EdgeFetcher, more specifically AnnoyModelFetcher with cacheTTLInSecs as -1.

      cacheTTLInSecs -1 means we initialize EdgeFetcher instance instead of using local cached instance.

      SafeUpdateCache put newly instantiated EdgeFetcher instance into guava cache, then call `onEvict` method defined in ResourceManager, which immediately call close() on Annoy4s JNI library, which causes the segmentation fault.

      One quick fix on this issue is scheduling EdgeFetcher's close method in a short period of time delay in the background.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                steamshon Do Yung Yoon
                Reporter:
                steamshon Do Yung Yoon
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: