Details
-
Suggestion
-
Resolution: Fixed
-
None
-
None
Description
When we try to reach review inbox (/cru?filter=inbox) it may load several minutes despite showing only one page of reviews. It was reported the load caused 43k SQL queries to be run:
1 select alluserspa0_.cru_ps as cru1_1_1_, alluserspa0_.cru_ps as cru1_1_, alluserspa0_.cru_action_name as cru2_1_, alluserspa0_.cru_ps as cru1_2_0_, alluserspa0_.cru_action_name as cru2_2_0_ from cru_ps_all_user alluserspa0_ where alluserspa0_.cru_ps=? order by alluserspa0_.cru_action_name asc 398 select comment0_.cru_comment_id as cru1_23_0_, comment0_.cru_create_date as cru2_23_0_, comment0_.cru_updated_date as cru3_23_0_, comment0_.cru_message as cru4_23_0_, comment0_.cru_draft as cru5_23_0_, comment0_.cru_deleted as cru6_23_0_, comment0_.cru_defect_raised as cru7_23_0_, comment0_.cru_comment_issue_key as cru8_23_0_, comment0_.cru_defect_approved as cru9_23_0_, comment0_.cru_user_id as cru10_23_0_, comment0_.cru_review_id as cru11_23_0_, comment0_.cru_reply_to_comment_id as cru12_23_0_ from cru_comment comment0_ where comment0_.cru_comment_id=? 627 select commentrea0_.cru_comment as cru4_23_1_, commentrea0_.cru_comment_read_status_id as cru1_1_, commentrea0_.cru_comment_read_status_id as cru1_27_0_, commentrea0_.cru_read as cru2_27_0_, commentrea0_.cru_user as cru3_27_0_, commentrea0_.cru_comment as cru4_27_0_ from cru_comment_read_status commentrea0_ where commentrea0_.cru_comment=? 686 select comments0_.cru_reply_to_comment_id as cru12_23_1_, comments0_.cru_comment_id as cru1_1_, comments0_.cru_comment_id as cru1_23_0_, comments0_.cru_create_date as cru2_23_0_, comments0_.cru_updated_date as cru3_23_0_, comments0_.cru_message as cru4_23_0_, comments0_.cru_draft as cru5_23_0_, comments0_.cru_deleted as cru6_23_0_, comments0_.cru_defect_raised as cru7_23_0_, comments0_.cru_comment_issue_key as cru8_23_0_, comments0_.cru_defect_approved as cru9_23_0_, comments0_.cru_user_id as cru10_23_0_, comments0_.cru_review_id as cru11_23_0_, comments0_.cru_reply_to_comment_id as cru12_23_0_ from cru_comment comments0_ where comments0_.cru_reply_to_comment_id=? 51 select comments0_.cru_review_id as cru1_16_1_, comments0_.cru_comment_id as cru2_1_, comment1_.cru_comment_id as cru1_23_0_, comment1_.cru_create_date as cru2_23_0_, comment1_.cru_updated_date as cru3_23_0_, comment1_.cru_message as cru4_23_0_, comment1_.cru_draft as cru5_23_0_, comment1_.cru_deleted as cru6_23_0_, comment1_.cru_defect_raised as cru7_23_0_, comment1_.cru_comment_issue_key as cru8_23_0_, comment1_.cru_defect_approved as cru9_23_0_, comment1_.cru_user_id as cru10_23_0_, comment1_.cru_review_id as cru11_23_0_, comment1_.cru_reply_to_comment_id as cru12_23_0_ from cru_review_comment comments0_ inner join cru_comment comment1_ on comments0_.cru_comment_id=comment1_.cru_comment_id where comments0_.cru_review_id=? order by comments0_.cru_comment_id asc 51 select count(*) as col_0_0_ from cru_frx filerevisi0_ where filerevisi0_.cru_review_id = ? 13682 select frxcomment0_.cru_frx_id as cru2_0_1_, frxcomment0_.cru_comment_id as cru1_1_, frxcomment0_.cru_comment_id as cru1_32_0_, frxcomment0_.cru_frx_id as cru2_32_0_ from cru_frx_comment frxcomment0_ where frxcomment0_.cru_frx_id=? order by frxcomment0_.cru_comment_id asc 13682 select frxrevisio0_.cru_frx_id as cru5_0_2_, frxrevisio0_.cru_frx_rev_id as cru1_2_, frxrevisio0_.cru_frx_rev_id as cru1_22_1_, frxrevisio0_.cru_date_added as cru2_22_1_, frxrevisio0_.cru_revision_order as cru3_22_1_, frxrevisio0_.cru_revision as cru4_22_1_, frxrevisio0_.cru_frx_id as cru5_22_1_, cruciblere1_.cru_revision_id as cru1_20_0_, cruciblere1_.cru_create_date as cru2_20_0_, cruciblere1_.cru_commit_date as cru3_20_0_, cruciblere1_.cru_author_name as cru4_20_0_, cruciblere1_.cru_deletion as cru5_20_0_, cruciblere1_.cru_file_type as cru6_20_0_, cruciblere1_.cru_binary as cru7_20_0_, cruciblere1_.cru_added as cru8_20_0_, cruciblere1_.cru_modified as cru9_20_0_, cruciblere1_.cru_moved as cru10_20_0_, cruciblere1_.cru_copied as cru11_20_0_, cruciblere1_.cru_detail_version as cru12_20_0_, cruciblere1_.cru_source_name as cru13_20_0_, cruciblere1_.cru_path as cru14_20_0_, cruciblere1_.cru_revision as cru15_20_0_, cruciblere1_.cru_revision_display_name as cru16_20_0_, cruciblere1_.cru_upload_item as cru17_20_0_, cruciblere1_.cru_oversize as cru18_20_0_ from cru_frx_revision frxrevisio0_ left outer join cru_revision cruciblere1_ on frxrevisio0_.cru_revision=cruciblere1_.cru_revision_id where frxrevisio0_.cru_frx_id=? order by frxrevisio0_.cru_revision_order 51 select frxs0_.cru_review_id as cru8_16_1_, frxs0_.cru_frx_id as cru1_1_, frxs0_.cru_frx_id as cru1_0_0_, frxs0_.cru_when_added as cru2_0_0_, frxs0_.cru_reviewed as cru3_0_0_, frxs0_.cru_further_action as cru4_0_0_, frxs0_.cru_review_scope as cru5_0_0_, frxs0_.cru_frx_order as cru6_0_0_, frxs0_.cru_show_as_diff as cru7_0_0_, frxs0_.cru_review_id as cru8_0_0_ from cru_frx frxs0_ where frxs0_.cru_review_id=? order by frxs0_.cru_frx_id 13682 select inlinecomm0_.cru_frx_id as cru2_0_1_, inlinecomm0_.cru_comment_id as cru1_1_, inlinecomm0_.cru_comment_id as cru1_30_0_, inlinecomm0_.cru_frx_id as cru2_30_0_ from cru_inline_comment inlinecomm0_ where inlinecomm0_.cru_frx_id=? order by inlinecomm0_.cru_comment_id asc 51 select participan0_.cru_review_id as cru2_16_1_, participan0_.cru_participant_id as cru1_1_, participan0_.cru_participant_id as cru1_33_0_, participan0_.cru_review_id as cru2_33_0_, participan0_.cru_user as cru3_33_0_, participan0_.cru_author as cru4_33_0_, participan0_.cru_moderator as cru5_33_0_, participan0_.cru_reviewer as cru6_33_0_, participan0_.cru_all_complete as cru7_33_0_, participan0_.cru_last_read as cru8_33_0_, participan0_.cru_status_change as cru9_33_0_, participan0_.cru_time_spent as cru10_33_0_, participan0_.cru_time_submitted as cru11_33_0_ from cru_review_participant participan0_ where participan0_.cru_review_id=? order by participan0_.cru_participant_id asc 51 select permaidhis0_.cru_review_id as cru3_16_1_, permaidhis0_.cru_proj_key as cru1_1_, permaidhis0_.cru_number as cru2_1_, permaidhis0_.cru_proj_key as cru1_13_0_, permaidhis0_.cru_number as cru2_13_0_, permaidhis0_.cru_review_id as cru3_13_0_ from cru_revpermaid permaidhis0_ where permaidhis0_.cru_review_id=? 1 select permission0_.cru_ps_id as cru1_1_0_, permission0_.cru_name as cru2_1_0_ from cru_perm_scheme permission0_ where permission0_.cru_ps_id=? 5 select repository0_.cru_repo_prop_id as cru1_50_, repository0_.cru_repository as cru2_50_, repository0_.cru_property_name as cru3_50_, repository0_.cru_repo_prop_hash as cru4_50_, repository0_.cru_value as cru5_50_ from cru_repository_property repository0_ where repository0_.cru_repository=? and repository0_.cru_property_name=? 2 select review0_.cru_review_id as cru1_16_, review0_.cru_review_type as cru2_16_, review0_.cru_name as cru3_16_, review0_.cru_default_source as cru4_16_, review0_.cru_state as cru5_16_, review0_.cru_description as cru6_16_, review0_.cru_summary as cru7_16_, review0_.cru_allow_reviewer_to_join as cru8_16_, review0_.cru_create_date as cru9_16_, review0_.cru_metrics_version as cru10_16_, review0_.cru_due_date as cru11_16_, review0_.cru_reminder_date as cru12_16_, review0_.cru_issue_key as cru13_16_, review0_.cru_parent_review as cru14_16_, review0_.cru_creator as cru15_16_, review0_.cru_project as cru16_16_ from cru_review review0_ where review0_.cru_review_id in (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) 1 select reviewrole0_.cru_ps as cru1_1_1_, reviewrole0_.cru_ps as cru1_1_, reviewrole0_.cru_pid as cru2_1_, reviewrole0_.cru_action_name as cru3_1_, reviewrole0_.cru_ps as cru1_3_0_, reviewrole0_.cru_pid as cru2_3_0_, reviewrole0_.cru_action_name as cru3_3_0_ from cru_ps_review_role reviewrole0_ where reviewrole0_.cru_ps=? order by reviewrole0_.cru_pid asc, reviewrole0_.cru_action_name asc 1 select this_.cru_login_cookie_id as cru1_55_0_, this_.cru_user_id as cru2_55_0_, this_.cru_rnd as cru3_55_0_, this_.cru_create_date as cru4_55_0_, this_.cru_type as cru5_55_0_, this_.cru_url as cru6_55_0_, this_.cru_recursive_url as cru7_55_0_ from cru_login_cookie this_ where this_.cru_user_id=? and this_.cru_type=? and this_.cru_url=? and this_.cru_recursive_url=? 4 select this_.cru_project_id as cru1_7_0_, this_.cru_name as cru2_7_0_, this_.cru_proj_key as cru3_7_0_, this_.cru_default_repository_name as cru4_7_0_, this_.cru_allow_reviewers_to_join as cru5_7_0_, this_.cru_store_revisions as cru6_7_0_, this_.cru_default_duration as cru7_7_0_, this_.cru_default_objectives as cru8_7_0_, this_.cru_permission_scheme as cru9_7_0_, this_.cru_default_moderator as cru10_7_0_, this_.cru_disable_moderator as cru11_7_0_ from cru_project this_ where lower(this_.cru_proj_key)=? 15 select user0_.cru_user_id as cru1_14_1_, user0_.cru_user_name as cru2_14_1_, user0_.cru_email as cru3_14_1_, user0_.cru_passwordhash as cru4_14_1_, user0_.cru_authtype as cru5_14_1_, user0_.cru_displayname as cru6_14_1_, user0_.cru_fisheye_enabled as cru7_14_1_, user0_.cru_crucible_enabled as cru8_14_1_, user0_.cru_passwordreset_srnd as cru9_14_1_, user0_.cru_passwordresettimestamp as cru10_14_1_, user0_.cru_failedlogincount as cru11_14_1_, user0_.cru_timezone as cru12_14_1_, userprofil1_.cru_user_id as cru1_15_0_, userprofil1_.cru_tabwidth as cru2_15_0_, userprofil1_.cru_cookieprefs as cru3_15_0_, userprofil1_.cru_watchmode as cru4_15_0_, userprofil1_.cru_emailformat as cru5_15_0_, userprofil1_.cru_changesetsperpage as cru6_15_0_, userprofil1_.cru_maxfilesperchangeset as cru7_15_0_, userprofil1_.cru_ideconnectorport as cru8_15_0_, userprofil1_.cru_enableide as cru9_15_0_, userprofil1_.cru_context as cru10_15_0_, userprofil1_.cru_upload_type as cru11_15_0_, userprofil1_.cru_upload_method as cru12_15_0_, userprofil1_.cru_upload_charset as cru13_15_0_, userprofil1_.cru_auto_mark_files as cru14_15_0_, userprofil1_.cru_dont_send_me_my_notes as cru15_15_0_, userprofil1_.cru_state_change_email_note as cru16_15_0_, userprofil1_.cru_comment_email_note as cru17_15_0_, userprofil1_.cru_reply_email_note as cru18_15_0_, userprofil1_.cru_general_email_note as cru19_15_0_, userprofil1_.cru_complete_email_note as cru20_15_0_, userprofil1_.cru_uncomplete_email_note as cru21_15_0_, userprofil1_.cru_uncomplete_on_defect as cru22_15_0_, userprofil1_.cru_uncomplete_on_rev_added as cru23_15_0_ from cru_user user0_ left outer join cru_user_profile userprofil1_ on user0_.cru_user_id=userprofil1_.cru_user_id where user0_.cru_user_id=? 1 select user0_.cru_user_id as cru1_14_, user0_.cru_user_name as cru2_14_, user0_.cru_email as cru3_14_, user0_.cru_passwordhash as cru4_14_, user0_.cru_authtype as cru5_14_, user0_.cru_displayname as cru6_14_, user0_.cru_fisheye_enabled as cru7_14_, user0_.cru_crucible_enabled as cru8_14_, user0_.cru_passwordreset_srnd as cru9_14_, user0_.cru_passwordresettimestamp as cru10_14_, user0_.cru_failedlogincount as cru11_14_, user0_.cru_timezone as cru12_14_ from cru_user user0_ where user0_.cru_user_name=? and (user0_.cru_fisheye_enabled=1 or user0_.cru_crucible_enabled=1) 1 select userpas0_.cru_ps as cru1_1_1_, userpas0_.cru_ps as cru1_1_, userpas0_.cru_pid as cru2_1_, userpas0_.cru_action_name as cru3_1_, userpas0_.cru_ps as cru1_5_0_, userpas0_.cru_pid as cru2_5_0_, userpas0_.cru_action_name as cru3_5_0_ from cru_ps_user userpas0_ where userpas0_.cru_ps=? order by userpas0_.cru_pid asc, userpas0_.cru_action_name asc
And callstacks point at:
"qtp1902237905-780" #780 prio=5 os_prio=0 tid=0x000000000272a800 nid=0x502a runnable [0x00007fb925294000] java.lang.Thread.State: RUNNABLE at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:668) at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3380) at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:520) at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:230) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:154) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:58) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1175) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1251) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at com.atlassian.fecru.user.HibernateBuiltinGroupDAO.listGroupsForUser(HibernateBuiltinGroupDAO.java:102) at com.atlassian.fecru.user.HibernateBuiltinGroupDAO.listGroupNamesForUser(HibernateBuiltinGroupDAO.java:111) at com.atlassian.fecru.user.HibernateBuiltinGroupDAO.listGroupNamesForUser(HibernateBuiltinGroupDAO.java:16) at com.cenqua.fisheye.user.DefaultUserManager.getGroupsForUser(DefaultUserManager.java:1190) at sun.reflect.GeneratedMethodAccessor595.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196) at com.sun.proxy.$Proxy45.getGroupsForUser(Unknown Source) at com.cenqua.crucible.model.managers.impl.DefaultPermissionManager$10.doInTransaction(DefaultPermissionManager.java:290) at com.cenqua.crucible.model.managers.impl.DefaultPermissionManager$10.doInTransaction(DefaultPermissionManager.java:271) at com.atlassian.fisheye.spi.impl.DefaultTxTemplate.execute(DefaultTxTemplate.java:76) at com.cenqua.crucible.model.managers.impl.DefaultPermissionManager.canPrincipalDoActionOnAllReviews(DefaultPermissionManager.java:271) at com.cenqua.crucible.model.managers.impl.DefaultPermissionManager$8.doInTransaction(DefaultPermissionManager.java:199) at com.cenqua.crucible.model.managers.impl.DefaultPermissionManager$8.doInTransaction(DefaultPermissionManager.java:195) at com.atlassian.fisheye.spi.impl.DefaultTxTemplate.execute(DefaultTxTemplate.java:76) at com.cenqua.crucible.model.managers.impl.DefaultPermissionManager.canPrincipalDoAction(DefaultPermissionManager.java:195) at com.cenqua.crucible.tags.ReviewUtil.principalCanDoReviewAction(ReviewUtil.java:199) at com.cenqua.crucible.model.Review.checkUserCanComment(Review.java:1001) at com.cenqua.crucible.model.Comment.isRead(Comment.java:375) at com.cenqua.crucible.model.discussion.DiscussionClauses$10.test(DiscussionClauses.java:186) at com.cenqua.crucible.model.discussion.DiscussionClauses$11.test(DiscussionClauses.java:205) at com.cenqua.crucible.model.managers.DiscussionBrowserImpl$1.visit(DiscussionBrowserImpl.java:44) at com.cenqua.crucible.model.Comment.visit(Comment.java:104) at com.cenqua.crucible.model.Comment.visit(Comment.java:100) at sun.reflect.GeneratedMethodAccessor249.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:198) at com.cenqua.crucible.model.Comment_$$_javassist_48.visit(Comment_$$_javassist_48.java) at com.cenqua.crucible.model.managers.DiscussionBrowserImpl.traverseDiscussion(DiscussionBrowserImpl.java:40) at com.cenqua.crucible.model.managers.FRXDiscussionBrowserImpl.traverseFRXDiscussions(FRXDiscussionBrowserImpl.java:49) at com.cenqua.crucible.model.managers.ReviewDiscussionBrowserImpl.traverseReviewDiscussions(ReviewDiscussionBrowserImpl.java:56) at com.cenqua.crucible.model.managers.DefaultCommentManager$1.visit(DefaultCommentManager.java:106) at com.cenqua.crucible.model.managers.DiscussionBrowserImpl.collect(DiscussionBrowserImpl.java:65) at com.cenqua.crucible.model.managers.DiscussionBrowserImpl.count(DiscussionBrowserImpl.java:60) at com.cenqua.crucible.view.ReviewRowDetail.getReadReviewCommentCount(ReviewRowDetail.java:143) at com.cenqua.crucible.view.ReviewRowDetail.getUnreadReviewCommentCount(ReviewRowDetail.java:156) at sun.reflect.GeneratedMethodAccessor697.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at javax.el.BeanELResolver.getValue(BeanELResolver.java:305) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188) at com.sun.el.parser.AstValue.getValue(AstValue.java:120) at com.sun.el.parser.AstValue.getValue(AstValue.java:167) at com.sun.el.parser.AstNotEqual.getValue(AstNotEqual.java:58) at com.sun.el.parser.AstAnd.getValue(AstAnd.java:63) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224) at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1009) at org.apache.jsp.tag.web.review.reviewResultListView_tag._jspx_meth_c_if_7(reviewResultListView_tag.java:818) at org.apache.jsp.tag.web.review.reviewResultListView_tag.doTag(reviewResultListView_tag.java:184) at org.apache.jsp.tag.web.cru.reviewTable_tag._jspx_meth_rev_reviewResultListView_0(reviewTable_tag.java:556) at org.apache.jsp.tag.web.cru.reviewTable_tag._jspx_meth_c_forEach_0(reviewTable_tag.java:523) at org.apache.jsp.tag.web.cru.reviewTable_tag.doTag(reviewTable_tag.java:187) at org.apache.jsp.WEB_002dINF.jsp.crucible.home.dashboard_jsp._jspx_meth_rend_reviewTable_0(dashboard_jsp.java:689) at org.apache.jsp.WEB_002dINF.jsp.crucible.home.dashboard_jsp._jspx_meth_c_otherwise_1(dashboard_jsp.java:660) at org.apache.jsp.WEB_002dINF.jsp.crucible.home.dashboard_jsp._jspx_meth_c_choose_1(dashboard_jsp.java:604) at org.apache.jsp.WEB_002dINF.jsp.crucible.home.dashboard_jsp.access$1100(dashboard_jsp.java:7) at org.apache.jsp.WEB_002dINF.jsp.crucible.home.dashboard_jsp$dashboard_jspHelper.invoke8(dashboard_jsp.java:879) at org.apache.jsp.WEB_002dINF.jsp.crucible.home.dashboard_jsp$dashboard_jspHelper.invoke(dashboard_jsp.java:935) at org.apache.jsp.tag.web.cru.threePanelPageContent_tag.doTag(threePanelPageContent_tag.java:615) at org.apache.jsp.WEB_002dINF.jsp.crucible.home.dashboard_jsp._jspx_meth_rend_threePanelPageContent_0(dashboard_jsp.java:204) at org.apache.jsp.WEB_002dINF.jsp.crucible.home.dashboard_jsp._jspService(dashboard_jsp.java:141) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1526)
It looks like in order to show total/unread counts for comments Fisheye loads everything related to the reviews. And number of queries is multiplied by number of files in reviews - 13682 for the queries above.