Gert-dev / php-ide-serenata

Atom IDE package that integrates the Serenata server to provide PHP code assistance
https://serenata.gitlab.io/
Other
274 stars 19 forks source link

indexing stuck on everytime modified php file #431

Closed Ulll closed 6 years ago

Ulll commented 6 years ago

Env:

macOS High Sierra 10.13.4

PHP 7.1.17 (cli) (built: May 3 2018 11:06:17) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

when indexing the project sucessful on the first time, everything is ok. but after restart atom, indexing action will cause stuck while everytime modified file. but Indexing Can't complete.

a screenshot

  1. first time : normal

  1. restart atom: indexing stuck

all Installed pkg:

atom-ide-ui intentions php-ide-serenata busy-signal project-manager

jatubio commented 6 years ago

The same for me:

Windows 2008 php-ide-sernata 4.1.2 PHP: PHP7.1.4

image

Only happens some times.

mallardduck commented 6 years ago

I've been having this issue as well. I'll admit that I had no clue about the rename/rebrand to serenata and was using the old version for what was probably way too long. I didn't experience the issue before upgrading to the new project. Not sure if or how much that helps but that's something I observed.

infomaniac50 commented 6 years ago

I've been able to work around this by killing the php process that hosts the Serenata server. When the client requests something, the server gets restarted and everything continues normally.

This is a screenshot of htop with the Serenata PHP process highlighted by F9[Kill].

screenshot_2018-05-27_20-11-29

Ulll commented 6 years ago

421 thanks @Gert-dev , has point out the solution:disable xdebug ; that solved my problem ~~

mallardduck commented 6 years ago

@Ulll yeah I believe this is correct. was meaning to report back after I read that issue and attempted some things. Turning off xdebug did seem to be the fix i needed - so I implemented a script similar to what was linked in there and have had much better results.

twifty commented 6 years ago

@Ulll Disabling XDebug is not a fix, it is a workaround. Some projects require XDebug for debugging/testing. IMO This issue should remain open.

mallardduck commented 6 years ago

@twifty I think you should check out #421 since these are very similar and likely the same underlying bug that the creator explains in there.

Further there shouldn't be any project that's affected by this change at run time. As long as the project can be linted/indexed without xdebug (it should) then nothing changes for you.

As I mentioned in my follow-up comment there's someone that suggests making a bash script to remove xdebug and then you set the serenata (and only serenata) php bin path to this script instead. This inturn fixes the serenata issue and does not affect runtime execution that requires xdebug.

EDIT: updated issue number since I messed up on mobile

twifty commented 6 years ago

@mallardduck Launching serenata without XDebug would indeed result in a performance increase (and the hiding of this bug). But unless a "bash" script is readily available, and bundled with, and used by, serenata, then the only way for end users to disable XDebug is from within their php.ini file. Changing this results in a system wide disable, which unless the end user is going to use the dzend_extension command line options to launch ALL their other scripts, is not a fix.

Almost all my projects use phpunit which requires XDebug to be loaded.

Until this bug is verified as being a result of the same underlying problem, it really should remain open.

mallardduck commented 6 years ago

@twifty I agree that everything would be much more convenient if there was a bash script included by default. However I can also see how doing so in a way that respected every system and OS this package and atom can run on would be untenable.

I also think you're still missing my point about how you can account for unique factors of your system by setting up the script yourself and just changing the path setting for this package alone. As I mentioned the other issue has someone that shared the script they've used. So it's not as you say here:

unless the end user is going to use the dzend_extension command line options to launch ALL their other scripts, is not a fix.

Here is the version of the script I've used: https://gist.github.com/mallardduck/51816d2f262385b894c0b7ced36af1ab

If you put this file in a PATH'd folder (local user bin or elsewhere) then give it execution permissions then you can set it for Serenata's PHP path in Atom. This has not affected me running PHPunit in CLI, nor has it affected Atoms PHP path (if you're using atom-ide and ide-php).

So the main reason adding this script in isn't super useful (IMHO) is because ATOM and this package can work on windows too. This script and work around doesn't work on Windows. Further Linux distros can vary in how they install PHP and where they default configs to be at.

On arch I get away with simply loading no config and then loading the default config manually since this forces it to not check the conf.d folder that enables xdebug any other time PHP executes. If you're on a distro that has you use the main php.ini then the fix doesn't work as is and would need modifications.

Finally I gotta apologize since I just noticed I messed up on mobile and linked the wrong issue. The correct issue is #421 and as far as I can tell Gert did confirm for us it's the same issue in this comment: https://github.com/Gert-dev/php-ide-serenata/issues/421#issuecomment-389223798

jatubio commented 6 years ago

On windows I have duplicated the folder of PHP instalation, change the config on this new folder to remove Xdebug and pointed serenata config to this new folder. Seems to work ok.