-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Revert "fix: handle queries on non-existing table gracefully " #4468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7c62701 to
693c1aa
Compare
Temporarily revert commit 390ba19 to help with debugging PostgREST#4462
693c1aa to
869818e
Compare
|
See #4472 |
|
I wonder why #3869 would cause #4462 (comment)? @taimoorzaeem Any ideas? It would make sense to consume considerable memory for 125K tables at schema cache creation time, but why would it keep increasing as postgrest/src/PostgREST/Plan.hs Lines 813 to 817 in d905592
|
It's quite strange. I tried tracing it and on error cases, control flow ends on the evaluation of postgrest/src/PostgREST/Error.hs Line 435 in 50eec77
I am debugging further to get to the root cause. |
|
I tried to run the fuzzy search operation on a large set. I got the source tarball of fuzzyset-0.2.4 and built it with -- [~/github/fuzzyset]$ cabal v2-repl
ghci> import Data.FuzzySet
ghci> import Data.Text
ghci> fuzzyset = fromList ([ pack ("unknown_table_" <> show (i :: Int)) | i <- [1..100000]])
ghci> getOne fuzzyset (pack "table-with-a-weird-name")
Error: [Cabal-7125]
repl failed for fuzzyset-0.2.4. The build process was killed (i.e. SIGKILL). The typical
reason for this is that there is not enough memory available (e.g. the OS killed a
process using lots of memory).The memory and CPU consumption spiked to 100% and then either the OS kills the process like above or the process nearly kills my OS (a few times it caused my ubuntu OS to kill all processes and logged out 😿). This does not seem safe. The PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 61689 taimooz 20 0 1024.5g 9.8g 128160 S 100.3 85.8 0:25.65 ghc-9.4+ In Nix EnvironmentHowever, if I try the same thing in postgrest nix-shell environment, the CPU spikes to 100% but the MEM usage remains low and the OS does not kill the process the expression eventually (takes about 1-2 minutes) evaluates to
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 62098 taimooz 20 0 1024.8g 987124 174764 S 100.3 6.3 0:53.05 ghc Now, this is my analysis so far and from just testing in |
Temporarily revert commit 390ba19 to help with debugging #4462
Edit: it was confirmed on #4462 that this revert solves the issue.