You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Juan Pablo Santos Rodríguez (Jira)" <ji...@apache.org> on 2020/09/25 18:04:00 UTC

[jira] [Commented] (JSPWIKI-1131) Lucene Index not updated on edits/new page

    [ https://issues.apache.org/jira/browse/JSPWIKI-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17202341#comment-17202341 ] 

Juan Pablo Santos Rodríguez commented on JSPWIKI-1131:
------------------------------------------------------

Hi, been able to reproduce the bug, seems that there are two separate issues here:

* the attached exception: seems that workflows are not entirely serializable - they have associated tasks, which are a type of steps, which store Contexts, which aren't serializable. Workflow with attached tasks are serialized when writting the completed workflows list. Hence the exception. This isn't catched by current tests, IIRC, they start a workflow, don't finish it and invoke the (de)serialization stuff.
* an exception serializing workflows should not affect search indexing or any other thing, if there is an exception when (de)serialization is taking place, it is logged and swallowed, with JSPWiki resuming its normal activity. Seems to me that search indexing event is not being fired at all, not being related to the exception noted above. Have to take a closer look at it, though.

As of how to fix first point, I was thinking to refactor tasks, so they don't store a context; Tasks should extract needed information from Context and store it, instead of directly storing Context. This is easy to do, however, on the execute method, the tasks also make use of some engine's managers. Having a reference to the Context is easy to grab the Engine, but if we are going to not store the Context (or the Engine or whatever manager needed as none of them are Serializable), then we have to pass the Engine as a parameter to the execute() method. This involves some refactoring on the workflow code. It is not specially complicated, but it involves a number of classes on the workflow package, so I've to take a better look at it.

As for the second point, it may be as simple as firing the search index event, but as said, I'd prefer to have a better look at it in order to see what's happening to properly fix it. Will increase the severity of the issue because of this second point.

(and apologies on the late response, not having too much time to spend on JSPWiki these past months)

> Lucene Index not updated on edits/new page
> ------------------------------------------
>
>                 Key: JSPWIKI-1131
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-1131
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.11.0-M7
>         Environment: * Debian 10
>  * Tomcat 9: 9.0.31-1~deb10u2
>  * OpenJDK-JRE 11: 11.0.7+10-3~deb10u1
>  * JSPWiki 2.11.0-M7
>            Reporter: FP
>            Priority: Major
>         Attachments: exception.txt
>
>
> It seems that the lucene search index is not updated when a user edits an existing page or creates a new page. In both cases, the page is not found when someone searches for it.
> Search works as expected when:
>  * Tomcat is stopped
>  * The files in the {{lucene}} directory are removed
>  * Tomcat is started
>  * Wait until the Lucene Indexer thread finishes reindexing
> The following exception occurs when a page is edited (full stack trace attached):
> {{java.io.NotSerializableException: org.apache.wiki.WikiContext}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)