Hippocampome-Org / php

Hippocampome web portal
3 stars 2 forks source link

K1M: certain query crashes the site #511

Open k1moradi opened 4 years ago

k1moradi commented 4 years ago

I tried to resolve the following query that made our site unresponsive for hours.

Neuron:(Neurotransmitter:Excitatory AND Morphology:(Dendrites:EC:22?000 AND Soma:EC:?1????) AND Electrophysiology:(Rin:<70 AND Vrest:>-64) AND FiringPatternparameter:(istim_pa:>=200 AND delay_ms:>100) NOT (Markers:(D-:RLN OR I-:RLN OR D±:RLN OR I±:RLN) OR Name:LEC))

drdiek commented 4 years ago

Taking out the phrase "AND FiringPatternparameter:(istim_pa:>=200 AND delay_ms:>100)," I got no hits. Taking out the phrase "NOT (Markers:(D-:RLN OR I-:RLN OR D±:RLN OR I±:RLN) OR Name:LEC)," I got no hits. Taking out both phrases, I ended up with MEC LII Stellate cells.

When I run the full query, I also end up with the site hanging for a while, even after I close the offending tab, so I am unsure what could possibly be going on.

k1moradi commented 4 years ago

It seems like an infinite loop to me that happens because of a corrupt query. If I put all conditions before "NOT" in parenthesis there is no hanging. I think we need to detect fuzzy queries and throw an informative error or automatically fix it using regex before running it. By fix, I mean if there is only one NOT statement we can put everything before it in parenthesis automatically. Does this make sense?

drdiek commented 4 years ago

@k1moradi I understand what you are asking for in terms of a fix, but I nowhere near have the skillset in php to make the improvements you are suggesting. I am unsure whether or not @nmsutton has the necessary skills and understanding to fix it either. In short, I do not know when this problem might get remedied.

nmsutton commented 4 years ago

@k1moradi @drdiek Thanks for reporting this Keivan and for investigating it Diek! I am in the middle of working on an issue directly related to trying to get the connection probabilities article ready for submission (the tool one) and I have not yet looked into this. I will look into it further later unless it is said that this is an immediate need. I will see if I have the skillset once I look into this later.

k1moradi commented 4 years ago

Thank you all. This issue is not blocking our progress, but it should be fixed whenever we had time since leads to a temporary crash of the site.