eyecite icon indicating copy to clipboard operation
eyecite copied to clipboard

HyperScan ScratchInUseError

Open sentry[bot] opened this issue 1 year ago • 5 comments

This one has occurred once so far:

Sentry Issue: COURTLISTENER-75S

ScratchInUseError: error code -10
(4 additional frame(s) were not displayed)
...
  File "cl/search/views.py", line 544, in show_results
    render_dict.update(do_search(request.GET.copy()))
  File "cl/search/views.py", line 222, in do_search
    query_citation = get_query_citation(cd)
  File "cl/lib/search_utils.py", line 102, in get_query_citation
    citations = get_citations(cd["q"], tokenizer=HYPERSCAN_TOKENIZER)

Filed by: @albertisfu

sentry[bot] avatar May 03 '24 18:05 sentry[bot]

Yikes, no results on Google:

image

mlissner avatar May 03 '24 20:05 mlissner

While debugging a separate issue related to hyperscan, I stumbled upon a docstring that explains this error:

/**
 * The scratch region was already in use.
 *
 * This error is returned when Hyperscan is able to detect that the scratch
 * region given is already in use by another Hyperscan API call.
 *
 * A separate scratch region, allocated with @ref hs_alloc_scratch() or @ref
 * hs_clone_scratch(), is required for every concurrent caller of the Hyperscan
 * API.
 *
 * For example, this error might be returned when @ref hs_scan() has been
 * called inside a callback delivered by a currently-executing @ref hs_scan()
 * call using the same scratch region.
 *
 * Note: Not all concurrent uses of scratch regions may be detected. This error
 * is intended as a best-effort debugging tool, not a guarantee.
 */
#define HS_SCRATCH_IN_USE       (-10)

Here's the description of a scratch-space from the dev-reference page:

  • https://intel.github.io/hyperscan/dev-reference/runtime.html#scratch-space

ERosendo avatar May 21 '24 14:05 ERosendo

Huh, weird. I guess this means we can do a retry as our best hope? I'm not sure how we're accessing the scratch region from multiple threads?

mlissner avatar May 22 '24 06:05 mlissner

Related:

Sentry Issue: COURTLISTENER-774

Filed by: @albertisfu

sentry[bot] avatar Jun 19 '24 18:06 sentry[bot]

This issue seems to be affecting the front-end now too, since we're now using eyecite while parsing queries:

Sentry Issue: COURTLISTENER-80Y

sentry[bot] avatar Aug 22 '24 22:08 sentry[bot]