Skip to content

Seeing "ScratchInUseError('error code -10')" when run hyperscan #175

Description

@YuehanZong

Hi team,

We are running following code to scan the text extracted from files, and getting this ScratchInUseError('error code -10'):

# Initialize db at the beginning only once.
db = hyperscan.Database()
db.compile(expressions=expressions, ids=ids, elements=len(patterns), flags=flags)

# Been called every time there's new file coming
hs_context = {"results": []}
db.scan(text, match_event_handler=self._on_match, context=hs_context)

The database is initialized only once at the beginning, and each time we encountered a file we call db.scan() method for hyperscan.

Wondering if there's a way to explicitly create new scratch space every time before we call db.scan(), and also free-up the space after scan completed? Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions