Confluence 9.0 EAP Feedback

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • None
    • Component/s: Server - EAP
    • None

      Hey there!

      We're in the process of migrating a confluence app to confluence 9. After upgrading to the latest confluence version and corresponding library upgrades we've ran into an issue with `CQLSearchService.searchContent` method.

      We're getting the following error in catalina.out,

      31-Jul-2024 13:58:17.782 WARNING [Catalina-utility-4] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread [http-nio-8090-exec-4 url: /rest/newsteaser/1.0/news/search.json; user: admin] (id=[205]) has been active for [68,074] milliseconds (since [7/31/24, 1:57 PM]) to serve the same request for [http://localhost:8090/rest/newsteaser/1.0/news/search.json?cql=(type%20IN%20(page%2C%20blogpost))%20order%20by%20lastmodified%20desc%20&limit=5&expand=body.view,body.view.webresource.uris.all,children.attachment,children.comment,space,version,metadata.likes,history&bodyType=summary] and may be stuck (configured threshold for this StuckThreadDetectionValve is [60] seconds). There is/are [1] thread(s) in total that are monitored by this Valve and may be stuck.
      	java.lang.Throwable
      		at java.base@17.0.11/java.lang.Object.wait(Native Method)
      		at org.eclipse.gemini.blueprint.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:104)
      		at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:427)
      		at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:400)
      
      

      Here's the code snippet causing the issue,

      public PageResponse<SliderEntryContent> search(
              @QueryParam("cql") String cql,
      	@QueryParam("bodyType") String bodyType,
      	@QueryParam("expand") @DefaultValue("") String expand,
      	final @QueryParam("start") int start,
      	final @QueryParam("limit") @DefaultValue("25") int limit,
      	@Context UriInfo uriInfo) {
      	
      	if (Strings.isNullOrEmpty(cql)) {
      		throw new BadRequestException("CQL query parameter is required but was empty");
      	}
      
      	try {
      		SearchPageResponse.Builder<SliderEntryContent> responseBuilder = SearchPageResponse.builder();
      		RestPageRequest pageRequest = new RestPageRequest(uriInfo, start, limit);
      
      		PageResponse<Content> contentEntries = searchService.searchContent(cql, pageRequest, ExpansionsParser.parse(expand));
      
      		List<SliderEntryContent> results = contentEntries.getResults().stream().
      					map(content -> newsManager.getNewsSliderEntry(bodyType, content)).collect(Collectors.toList());
      		responseBuilder.result(results);
      		responseBuilder.pageRequest(pageRequest);
      		responseBuilder.totalSize(results.size());
      		PageResponse<SliderEntryContent> response = responseBuilder.build();
      		PageResponse<SliderEntryContent> output = RestList.newRestList(response).pageRequest(pageRequest.copyWithLimits(response)).build();
      		return output;
      	} catch (Exception exc) {
      		LOG.error("Error generating page response in NewsResource.PageResponse method", exc);
      		return null;
      	}
      }
      

      The 3rd line in the try block is causing the issue.

      The library in pom.xml

      <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-rest-api</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
      </dependency>
      

      Help would be appreciated!

            Assignee:
            Nikhil Jain
            Reporter:
            pranshu.jethmalani
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: