tillt / RTagsComplete

Sublime Text 3 C, C++ and Objective C code completion, navigation plugin based on RTags.
7 stars 1 forks source link

No diagnose shown unless rdm was re/started. #22

Open tillt opened 6 years ago

tillt commented 6 years ago

Right now it appears as if rc --diagnose only ever returns information when the plugin was started after rdm. If one e.g. shuts down rdm while the plugin was active and then later restarts rdm, no errors/warnings/fixme's are displayed for files that get freshly indexed. The workaround is restarting sublime or the plugin.

tillt commented 5 years ago

Still have trouble reproducing this - it definitely does happen but the order and timing of things are unclear and make it hard locating the problem.

tillt commented 5 years ago

No, this is different. It appears that rdm needs a restart but not the plugin / sublime. I did run into this a couple of times now, the symptoms;

After saving a file, no diagnostics are shown even though rtags logs show that a fixit was diagnosed;

tail -f /usr/local/var/log/rtags.log
[...]
/usr/local/bin/rc -m
/usr/local/bin/rc -V /Users/till/Development/mesos-private/src/slave/containerizer/docker.cpp
[100%] 1/1 00:58:03 ~/Development/mesos-private/src/slave/containerizer/docker.cpp in 20671ms. (3395 syms, 2634 symNames, 36 includes, 1 of 1594 files, symbols: 5918 of 85854, 90154 cursors, 21914479 bytes written) (19769/762/97ms) (reindex). (priority 5)
Jobs took 20.72s. We're using 1917mb of memory.
/usr/local/bin/rc --diagnose /Users/till/Development/mesos-private/src/slave/containerizer/docker.cpp
Output from /Users/till/Development/mesos-private/src/slave/containerizer/docker.cpp:
Fixit for /Users/till/Development/mesos-private/src/slave/containerizer/docker.cpp:254:35: Replace 9 characters with "directoryf"

Rather interesting....

So we see that the plugin has started its monitoring thread;

/usr/local/bin/rc -m

We also see that a re-index was triggered;

/usr/local/bin/rc -V /Users/till/Development/mesos-private/src/slave/containerizer/docker.cpp

Then we see it did its job;

[100%] 1/1 00:58:03 ~/Development/mesos-private/src/slave/containerizer/docker.cpp in 20671ms. (3395 syms, 2634 symNames, 36 includes, 1 of 1594 files, symbols: 5918 of 85854, 90154 cursors, 21914479 bytes written) (19769/762/97ms) (reindex). (priority 5)
Jobs took 20.72s. We're using 1917mb of memory.

As the last step, the plugin explicitly asks for diagnostics;

/usr/local/bin/rc --diagnose /Users/till/Development/mesos-private/src/slave/containerizer/docker.cpp

And the log even shows that RTags has a fixit to offer;

Fixit for /Users/till/Development/mesos-private/src/slave/containerizer/docker.cpp:254:35: Replace 9 characters with "directoryf"

BUT, the plugin never receives any diagnostic information on the monitoring thread.

I was then doing the same outside the plugin to validate it was not RTagsComplete at fault; so I did start a monitoring process in one terminal, triggered a reindex of a file that did contain problems in another terminal. Lastly once the indexing was done, I triggered --diagnose and indeed the monitoring process never receives information while it should.

I then went ahead, restarted rdm and repeated the above -- now everything worked as expected.

tillt commented 5 years ago

The next step would be finding a minimal, reproducing scenario and filing it as an RTags issue.

tillt commented 5 years ago

So bizarre, but now it is official, we have both;

For confirming one or the other, run rc -m in the console and if a diagnose request does not show anything on the monitoring, we know rdm is at fault.

Still trying to find out more....