Fork me on GitHub
#lsp
<
2022-03-02
>
borkdude13:03:21

@ericdallo I'm having problems with lsp in the clj-kondo project itself. After a while my laptop's fans are spinning without actually doing anything.

ericdallo13:03:42

Each clojure-lsp proccess represents a project, do you really have 6 projects opened?

ericdallo13:03:56

even so, the first one is the one that is taking that much right?

borkdude13:03:14

yes, I really have 6 projects opened

borkdude13:03:24

and yes, only the first one, which is the clj-kondo one

ericdallo13:03:36

Right, this should be no problem, since they consume less resource after started

ericdallo13:03:46

does the clojure-lsp already started on the first one?

ericdallo13:03:27

I mean, is it running or starting on the clj-kondo buffer (analyzing stuff etc)?

borkdude13:03:45

it starts happening while I've been working on it for a while

ericdallo13:03:13

hum, so does starts correctly and after some time takes more cpu

ericdallo13:03:05

We could try something to check if it's the issue

ericdallo13:03:44

add to .clj-kondo/config.edn

{:linters {:clojure-lsp/unused-public-var {:level :off}}} 
to confirm that linter is causing that

borkdude13:03:32

I already have :linters {:clj-kondo {:level :off}} in my config

ericdallo13:03:11

hum, so it's probably not related with that linter

ericdallo13:03:29

I have no idea, after startup things are really fast and consume few resources

borkdude13:03:51

I also can't really reproduce this, it just starts after a while, maybe after my laptop has been sleeping and then reopening

ericdallo13:03:52

well I see 1 hour of that proccess running

ericdallo13:03:06

so it could be something really hard to debug

ericdallo13:03:11

meanwhile you can lsp-workspace-restart

borkdude13:03:01

but sometimes I notice this only after a few hours, because I wear headphones

😄 2
ericdallo13:03:51

sounds odd indeed, some corner case where it may stuck in a loop or something

ericdallo13:03:43

Usually I open lots of projects(4-10) and some big ones on Nubank and never faced that before

borkdude13:03:08

maybe you will hit it when working on clj-kondo as well.

ericdallo13:03:22

yes, maybe some corner case there

borkdude13:03:55

I will monitor the log file and then will come back to this when it happens again, thanks

👍 1
borkdude20:03:05

So far no problems....

🤞 1
jacob.maine20:03:15

@U04V15CAJ, @ericdallo this often happens for me after merging, rebasing, or switching branches—something that changes a lot of files simultaneously. I think that’s why it often only happens many hours after opening a project.

jacob.maine20:03:46

It gets stuck in a loop re-analyzing a single file or a small set of files. The log fills up with lines that look like this:

2022-03-02T02:14:59.049Z  INFO [clojure-lsp.feature.file-management:?] - changes analyzed by clj-kondo took 0.06 secs
@U04V15CAJ, if you have logging enabled, maybe you could confirm that’s what you see too the next time this happens

borkdude20:03:10

I enabled logging and will monitor - thanks

ericdallo20:03:51

makes sense @U07M2C8TT, we do have a logic on didChangeWatchedFilles (that we should improve to consider branch changes)

borkdude14:03:51

@ericdallo ok, I'm in the loop state now

borkdude14:03:59

I could share my screen with you and we could try to diagnose

borkdude14:03:09

The log file keeps going with:

2022-03-04T14:01:58.171Z  INFO [clojure-lsp.feature.file-management:?] - changes analyzed by clj-kondo took 0.61 secs
2022-03-04T14:01:58.985Z  INFO [clojure-lsp.feature.file-management:?] - changes analyzed by clj-kondo took 0.81 secs
2022-03-04T14:01:59.555Z  INFO [clojure-lsp.feature.file-management:?] - changes analyzed by clj-kondo took 0.57 secs
2022-03-04T14:02:00.224Z  INFO [clojure-lsp.feature.file-management:?] - changes analyzed by clj-kondo took 0.67 secs
2022-03-04T14:02:00.931Z  INFO [clojure-lsp.feature.file-management:?] - changes analyzed by clj-kondo took 0.71 secs
2022-03-04T14:02:01.550Z  INFO [clojure-lsp.feature.file-management:?] - changes analyzed by clj-kondo took 0.62 secs
2022-03-04T14:02:02.361Z  INFO [clojure-lsp.feature.file-management:?] - changes analyzed by clj-kondo took 0.81 secs

borkdude14:03:32

I will end this soon as my laptop makes a lot of noise now

borkdude14:03:35

hmm, sorry, I'll abort it now... too stressful

borkdude14:03:29

this happened after git reset --hard

ericdallo14:03:10

that helps a lot

ericdallo14:03:27

so indeed it's related with watched file changes, I even think I know what could be

ericdallo14:03:34

I'll investigate later today

borkdude14:03:52

thank you too

ericdallo14:03:00

I think we can do a repro creating 2 branches with a lot of changes one from the other

orestis15:03:02

My laptop doesn't have fans but I have also noticed than when switching branches etc lsp often “dies” as in it won't go to definitions or respond to commands. This is via calva, it gets stuck showing the progress bar which is normally not even noticeable.

borkdude15:03:59

I'm testing with Eric's new version (mentioned in that issue)

borkdude15:03:02

so far no problems

🤞 1