Issue #388 new

Exception during a search

Anonymous created an issue

I'm using Whoosh 2.6 with Apache 2 and Django (wsgi) on a production server. From time to time there an exception raised (see below) while retreating a hit. The weird thing is that I can't reproduce this systematically, it happens only from time to time even with exactly the same search parameters.

[16/May/2014 16:42:33] ERROR Internal Server Error: /digipal/search/ (base)
Traceback (most recent call last):
  File "/vol/digipal2/webroot/liv/django/envs/digipal-liv/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/vol/digipal2/webroot/liv/django/digipal-django/digipal/views/search.py", line 165, in search_record_view
    set_search_results_to_context(request, context=context, show_advanced_search_form=True)
  File "/vol/digipal2/webroot/liv/django/digipal-django/digipal/views/search.py", line 292, in set_search_results_to_context
    context['results'] = type.build_queryset(request, term, not has_result)
  File "/vol/digipal2/webroot/liv/django/digipal-django/digipal/views/content_type/search_content_type.py", line 636, in build_queryset
    ret = self._build_queryset(request, term)
  File "/vol/digipal2/webroot/liv/django/digipal-django/digipal/views/content_type/search_content_type.py", line 738, in _build_queryset
    whoosh_dict[int(hit['id'])] = hit
  File "/vol/digipal2/webroot/liv/django/envs/digipal-liv/lib/python2.6/site-packages/whoosh/searching.py", line 1501, in __getitem__
    if fieldname in self.fields():
  File "/vol/digipal2/webroot/liv/django/envs/digipal-liv/lib/python2.6/site-packages/whoosh/searching.py", line 1389, in fields
    self._fields = self.searcher.stored_fields(self.docnum)
  File "/vol/digipal2/webroot/liv/django/envs/digipal-liv/lib/python2.6/site-packages/whoosh/reading.py", line 712, in stored_fields
    sfs = self._perdoc.stored_fields(docnum)
  File "/vol/digipal2/webroot/liv/django/envs/digipal-liv/lib/python2.6/site-packages/whoosh/codec/whoosh3.py", line 489, in stored_fields
    v = reader[docnum]
  File "/vol/digipal2/webroot/liv/django/envs/digipal-liv/lib/python2.6/site-packages/whoosh/columns.py", line 1207, in __getitem__
    v = self._child[docnum]
  File "/vol/digipal2/webroot/liv/django/envs/digipal-liv/lib/python2.6/site-packages/whoosh/columns.py", line 807, in __getitem__
    v = VarBytesColumn.Reader.__getitem__(self, docnum)
  File "/vol/digipal2/webroot/liv/django/envs/digipal-liv/lib/python2.6/site-packages/whoosh/util/cache.py", line 95, in wrapper
    del data[k]
KeyError: (<CompressedBytes.Reader>, 1601L)

Comments (2)

  1. pleong

    This bug seems to happen when two HTTP requests are run at the same time. However I have checked the code and I'm not sharing the searchers. I logged the id of the index.searcher() in a file and they are distinct even when this error occurs.

  2. Log in to comment