This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257389

Summary: "Background scanning of projects..." neverending cycling with Python 3.x project
Product: python Reporter: maurogbelardi
Component: EditorAssignee: Jenselme
Status: NEW ---    
Severity: normal CC: Jenselme
Priority: P2 Keywords: PERFORMANCE
Version: 8.1   
Hardware: PC   
OS: All   
See Also: https://netbeans.org/bugzilla/show_bug.cgi?id=270904
Issue Type: DEFECT Exception Reporter:
Attachments: CPU use during backgroun scanning.
Sample ant project

Description maurogbelardi 2016-01-04 13:32:29 UTC
Created attachment 157984 [details]
CPU use during backgroun scanning.

Product Version: NetBeans IDE 8.1 (Build 201510222201)
Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b18
System: Windows 8 version 6.2 running on amd64; Cp1252; it_IT (nb)
User directory: C:\Users\Mauro Belardi\AppData\Roaming\NetBeans\8.1
Cache directory: C:\Users\Mauro Belardi\AppData\Local\NetBeans\Cache\8.1

My bug is very similar to "Bug 231579".

I've installed Python 3.5.1 using Anaconda3-2.4.1-Windows-x86_64 (with full libraries).

It's enough to create a new "Python project - Ant" to have NetBeans 8.1 cycling repedeatly on "Backgronund scanning of projects...". This happens always, also closing NB and restarting the pc.

It cycles every 2 seconds. Doing it, NetBeans absorbes 22% of processor on mean.

Running the script doesn't change anything.

Deleting the project resolves the problem: no more background scanning happens.

I attach CPU plot.

Good work.


Mauro Belardi
Comment 1 maurogbelardi 2016-01-04 13:43:30 UTC
Changing the project's property from Python 3.5.1 to 3.4.2 change nothing: the problem remains.

BUT: changing from Python 3.x to 2.7 all return working well!
Comment 2 Lou Dasaro 2016-01-04 20:32:02 UTC
Anomaly verified and assigned to engineer for evaluation.
Thank you.
Comment 3 Jenselme 2016-01-08 09:12:33 UTC
I fail to reproduce on either Linux or Windows 7:
Product Version: NetBeans IDE 8.1 (Build 201510222201)
Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b18
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)

I'll attach the project I used for my test. Tell me if you are able to reproduce with it. If you don't, please attach a sample project with the problem.
Comment 4 Jenselme 2016-01-08 09:13:07 UTC
Created attachment 158060 [details]
Sample ant project
Comment 5 maurogbelardi 2016-01-08 12:45:17 UTC
HI, 

I've yet tested your project. Again, NB cycles. But, to see the problem, you MUST set, in the project's properties, Python 3.4.2 or Python 3.5.1.

Setting Jython 2.7.0 the problem disappears.

Mauro
Comment 6 Jenselme 2016-01-08 13:15:23 UTC
> I've yet tested your project. Again, NB cycles. But, to see the problem, you MUST set, in the project's properties, Python 3.4.2 or Python 3.5.1.

That's what I did, I am using python 3.4.3 and I don't experience the problem. @Lou any ideas on that?
Comment 7 Lou Dasaro 2016-01-10 04:19:23 UTC
Anomaly seems to occur only on IDE 8.1 with the plugins from the Plugin Portal. Meaning I haven't been able to reproduce the anomaly using tryme-debug.
I will test with actual plugins built with more recent sources on IDE 8.1
N.B. We don't yet "officially" support Python 3.x., but more work is planned...
Comment 8 maurogbelardi 2016-01-10 10:18:29 UTC
Hi Guys,

the mere presence of a Python project 3.x.y in the NetBeans 8.1 list of projects triggers the problem. You don't need to run it.

I can develop without problems, but the processor power is wasted, the pc slowed and the battery life shortened. Unfortunately I must develop with Python >= 3.4.2 so I've no alternative.

Maybe, it can be interesting to observe the project.properties file in two different context (jython 2.7.0 vs python 3.5.1):

JYTHON 2.7.0
------------
java.lib.path=
main.file=iris.py
platform.active=default
python.lib.path=
src.dir=src

PYTHON 3.5.1
------------
java.lib.path=
main.file=iris.py
platform.active=Python_3.5.1
python.lib.path=
src.dir=src

The only difference is the version. Maybe the new type it's not enumerated?

Here I paste the plugin importer configuration:

org-netbeans-modules-autoupdate-pluginimporter.xml
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module SYSTEM "http://www.netbeans.org/dtds/module-status-1_0.dtd" PUBLIC "-//NetBeans//DTD Module Status 1.0//EN">
-<module name="org.netbeans.modules.autoupdate.pluginimporter">
<param name="autoload">false</param>
<param name="eager">false</param>
<param name="enabled">true</param>
<param name="jar">modules/org-netbeans-modules-autoupdate-pluginimporter.jar</param>
<param name="reloadable">false</param>
</module>

For other similar problems you can also read here:

http://stackoverflow.com/questions/28811246/netbeans-background-scanning-projects-takes-too-long

or here:

https://netbeans.org/bugzilla/show_bug.cgi?id=244246

Finally, I've tried disabling .py projects scanning, creating the file scanondemand.properties with this content:

.*\.py=IGNORE

in the directory:

C:\Users\Mauro Belardi\AppData\Roaming\NetBeans\8.1\config\Preferences\org\netbeans\modules

but it doesn't stop. Cycling the same, both Python 3.4.2 and Python 3.5.1.

Here the

Python core.properties
----------------------
dbg.dbgshell.background.color=\#FFFFFF
dbg.dbgshell.error.color=\#FF0000
dbg.dbgshell.font=Monospaced.plain-0-12
dbg.dbgshell.header.color=\#0000FF
dbg.dbgshell.messages.color=\#000000
dbg.dbgshell.warning.color=\#FFAFAF
dbg.listening.port=49152
dbg.stopatfirstline=true
platform-manager-called-first-time=false
projectPanelLastPlatformID=Python_3.4.2
prompt.for.args=false

If you will need more help, I will give it to you.

Good work.

Mauro
Comment 9 Lou Dasaro 2016-01-11 03:19:45 UTC
To be addressed as part of full support for Python 3.x
Occurs in both production plugin and the current plugin from development UC at: http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz
It is important to note that the anomaly doesn't occur immediately. So, when testing to reproduce the error, create some projects with different Python/Jython platforms including Python 3.x. Make some edits, run, click on different .py editor windows. 
If it doesn't occur, "go to lunch". 
I have found that if I leave the IDE idle for some minutes while doing other work, upon my return it is scanning every few seconds. If make an edit to a .py file, it appears to stop, but after some time starts intermittent scanning again.