[ 
https://issues.apache.org/jira/browse/TINKERPOP-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17680346#comment-17680346
 ] 

ASF GitHub Bot commented on TINKERPOP-2647:
-------------------------------------------

Cole-Greer commented on PR #1950:
URL: https://github.com/apache/tinkerpop/pull/1950#issuecomment-1402582382

   Thanks for your contributions here. Just so you are aware, we are currently 
in the middle of a code freeze for the upcoming 3.5.5 and 3.6.2 releases, as 
such there likely won't be much activity on PR's for the time being and it 
won't be merged until after the releases are done.
   
   I'm not too familiar with the console codebase so I cannot comment with too 
much authority here but the changes look good to me. I would prefer if the 
solution did not require building and iterating through so many hash sets. I 
would hope there is a simple way to check if the specific module being 
uninstalled also needs to be deactivated without looking at all the plugins. 
Without looking into it further though I'm not sure if this is indeed possible 
without further changes. There should never be that many plugins installed at 
any time so I don't think it's a big issue as it is currently implemented.
   
   One ask I have is that you base these changes off of the 3.5-dev branch 
instead of master. Our branch structure is that we target non breaking changes 
towards the earliest active development branch (currently 3.5-dev) and when a 
PR is merged, the changes will be pulled forward into the newer development 
branches as well (3.6-dev, master).
   
   Please let me know if you have any questions about this or if I can help in 
any way.




> :uninstall without first disabling a plugin will lead to error on startup
> -------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2647
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2647
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: console
>    Affects Versions: 3.4.12
>            Reporter: Stephen Mallette
>            Priority: Trivial
>
> In the Gremlin Console, if you add a plugin like:
> {code}
> gremlin> :install org.apache.tinkerpop spark-gremlin 3.6.0-SNAPSHOT
> ==>loaded: [org.apache.tinkerpop, spark-gremlin, 3.6.0-SNAPSHOT] - restart 
> the console to use [tinkerpop.spark]
> gremlin> :plugin use tinkerpop.spark
> ==>tinkerpop.spark activated
> {code}
> and then you choose to remove it:
> {code}
> gremlin> :uninstall spark-gremlin
> ==>Uninstalled spark-gremlin - restart the console for removal to take effect
> gremlin> :x
> {code}
> When you restart, the console will be in a bad state and produce this sort of 
> exception:
> {code}
> $ bin/gremlin.sh
>          \,,,/
>          (o o)
> -----oOOo-(3)-oOOo-----
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> plugin activated: tinkerpop.spark
> gremlin> :uninstall tinkerpop.spark
> ==>There is no module with the name tinkerpop.spark to remove - 
> /home/smallette/git/apache/tinkerpop/gremlin-console/target/apache-tinkerpop-gremlin-console-3.6.0-SNAPSHOT-standalone/ext/tinkerpop.spark
> gremlin> :uninstall spark-gremlin
> ==>Uninstalled spark-gremlin - restart the console for removal to take effect
> gremlin> :x
> smallette@ubuntu-vm:~/git/apache/tinkerpop/gremlin-console/target/apache-tinkerpop-gremlin-console-3.6.0-SNAPSHOT-standalone$
>  bin/gremlin.sh
>          \,,,/
>          (o o)
> -----oOOo-(3)-oOOo-----
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> Exception in thread "main" java.lang.NullPointerException: Cannot invoke 
> method activate() on null object
>       at 
> org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
>       at 
> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:43)
>       at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
>       at 
> org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:34)
>       at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
>       at org.apache.tinkerpop.gremlin.console.PluggedIn$activate.call(Unknown 
> Source)
>       at 
> org.apache.tinkerpop.gremlin.console.Console$_closure18.doCall(Console.groovy:149)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
>       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
>       at 
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
>       at groovy.lang.Closure.call(Closure.java:405)
>       at groovy.lang.Closure.call(Closure.java:421)
>       at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2330)
>       at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2315)
>       at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2356)
>       at org.codehaus.groovy.runtime.dgm$186.invoke(Unknown Source)
>       at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244)
>       at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
>       at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
>       at 
> org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:147)
>       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>       at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>       at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>       at 
> org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
>       at 
> org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
>       at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:265)
>       at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:524)
> {code}
> The reason for this issue is that the plugin registration in 
> {{ext/plugins.txt}} file is not cleaned up and so the console tries to load 
> it on startup. Normally you would {{:plugin unuse tinkerpop:spark}} prior to 
> the {{:uninstall}} to make sure the cleanup worked properly. 
> To fix this problem, {{:uninstall}} should just remove the registration the 
> same way that {{:plugin unuse}} would.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to