[MGNLPER-65] QuerySnifferProcessor always invokes operations against the first session ever logged in to the system Created: 14/Nov/18  Updated: 19/Nov/18  Resolved: 16/Nov/18

Status: Closed
Project: Periscope
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Task Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: 6.0_release
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Epic Link: Periscope back-end MVP
Sprint: Basel 160
Story Points: 1

 Description   

way to reproduce:

  • start instance
  • invoke open pages app command via findbar -> opens the pages app
  • restart the session (e.g. via ?restartApplication)
  • invoke the same operation in the new session -> BOOM, pages app fails to start with obscure IoC related issues

problem is that QuerySnifferProcessor caches the instances of the operations once and for all (in consider method). When the ops are created - they inject e.g. location controller inside. This means that every time the op is triggered - it'll use the same instance of a location controller. Not only it leaks in memory with the rest of the UI session stuff, but also renders the sniffer commands disfunctional.

I am not entirely sure that caching those commands is such a necessary thing in the first place, but as a simple solution I propose to cache the factories of query sniffers, i.e. storing the Collection<Supplier<QuerySniffer>> instead of Collection<QuerySniffer>.


Generated at Mon Feb 12 10:28:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.