Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE for SpnegoFilter #6338

Closed
electrum opened this issue Oct 12, 2016 · 1 comment
Closed

NPE for SpnegoFilter #6338

electrum opened this issue Oct 12, 2016 · 1 comment
Labels

Comments

@electrum
Copy link
Contributor

electrum commented Oct 12, 2016

Apparently, GSSContext.getSrcName() can return null, even if isEstablished() is true. I suppose we should handle that by returning Optional.empty()? Maybe with a debug log entry?

java.lang.NullPointerException
    at com.facebook.presto.server.security.SpnegoFilter.authenticate(SpnegoFilter.java:194)
    at com.facebook.presto.server.security.SpnegoFilter.doFilter(SpnegoFilter.java:154)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
    at io.airlift.http.server.TraceTokenFilter.doFilter(TraceTokenFilter.java:63)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
    at io.airlift.http.server.TimingFilter.doFilter(TimingFilter.java:52)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:386)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1176)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
    at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169)
    at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:518)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:314)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:186)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
    at java.lang.Thread.run(Thread.java:745)
@electrum electrum added the bug label Oct 12, 2016
@wdong87
Copy link

wdong87 commented Oct 13, 2016

It looks like the context was not well established according to this link: http://stackoverflow.com/questions/34306386/gsscontext-with-null-srcname. We need to understand why it's the case for the curl case. cc: @zhenyuy-fb

@electrum electrum closed this as completed Mar 1, 2021
branimir-vujicic added a commit to axiomq/presto that referenced this issue Sep 16, 2023
Feature Toggles should allow teams to modify system behavior without changing
code. Feature Toggles are configured using google guice. Basic definition of
toggles are crated using FeatureToggleBinder. FeatureToggleBinder creates
FeatureToggle and additional configuration can be done using feature
configuration.
In current stage Feature Toggles supports:
- if / else based feature toggles
- Dependency Injection based
  Hot reloading implementation without restart require code refactoring to
  add an interface when injecting the new implementation/class
- using various toggle strategies along with simple on / off toggles

configuration:

to allow feature toggle configuration four lines are needed in
config.properties file
```
features.config-source-type=file
features.config-source=/etc/feature-config.properties
features.config-type=properties
features.refresh-period=30s
```

`configuration-source-type` is source type for Feature Toggles configuration
`features.config-source` is a source (file) of the configuration
`features.config-type` format in which configuration is stored (json or properties)
`features.refresh-period` configuration refresh period

Defining Feature Toggles

Feature toggle definition is done in google guice module using `FeatureToggleBinder`

simple feature toggle definition
```
    featureToggleBinder(binder)
                        .featureId("featureXX")
                        .bind()
```
This example creates bindings for @Inject
```
    @Inject
    public Runner(@FeatureToggle("featureXX") Supplier<Boolean> isFeatureXXEnabled)
    {
        this.isFeatureXXEnabled = isFeatureXXEnabled;
    }
```
`isFeatureXXEnabled` can be used to test if feature is enabled or disabled:
```
    boolean testFeatureXXEnabled()
    {
        return isFeatureXXEnabled.get();
    }
```

hot reloadable feature toggle definition
```
featureToggleBinder(binder, Feature01.class)
                        .featureId("feature01")
                        .baseClass(Feature01.class)
                        .defaultClass(Feature01Impl01.class)
                        .allOf(Feature01Impl01.class, Feature01Impl02.class)
                        .bind()
```
adding Feature Toggle switching strategy
```
featureToggleBinder(binder)
                        .featureId("feature04")
                        .toggleStrategy("AllowAll")
                        .toggleStrategyConfig(ImmutableMap.of("key", "value", "key2", "value2"))
```

feature-config.properties file example
```
# feature query-logger
feature.query-logger.enabled=true
feature.query-logger.strategy=OsToggle
feature.query-logger.strategy.os_name=.*Linux.*

#feature.query-rate-limiter
feature.query-rate-limiter.currentInstance=com.facebook.presto.server.protocol.QueryBlockingRateLimiter

# feature.query-cancel
feature.query-cancel.strategy=AllowList
feature.query-cancel.strategy.allow-list-source=.*IDEA.*
feature.query-cancel.strategy.allow-list-user=.*prestodb
```
in this example for first feature `query-logger`
changing value of feature.query-logger.enabled to `false` will 'disable' this feature.
Changes will be effective within refresh period.
Pass column delimiter info to reader (prestodb#6338)

Summary: Pull Request resolved: facebookincubator/velox#6338

Reviewed By: Yuhta

Differential Revision: D48457913

fbshipit-source-id: 57d76dfa229de3801bf3181f780a485b628427ad
branimir-vujicic added a commit to axiomq/presto that referenced this issue Sep 18, 2023
Feature Toggles should allow teams to modify system behavior without changing
code. Feature Toggles are configured using google guice. Basic definition of
toggles are crated using FeatureToggleBinder. FeatureToggleBinder creates
FeatureToggle and additional configuration can be done using feature
configuration.
In current stage Feature Toggles supports:
- if / else based feature toggles
- Dependency Injection based
  Hot reloading implementation without restart require code refactoring to
  add an interface when injecting the new implementation/class
- using various toggle strategies along with simple on / off toggles

configuration:

to allow feature toggle configuration four lines are needed in
config.properties file
```
features.config-source-type=file
features.config-source=/etc/feature-config.properties
features.config-type=properties
features.refresh-period=30s
```

`configuration-source-type` is source type for Feature Toggles configuration
`features.config-source` is a source (file) of the configuration
`features.config-type` format in which configuration is stored (json or properties)
`features.refresh-period` configuration refresh period

Defining Feature Toggles

Feature toggle definition is done in google guice module using `FeatureToggleBinder`

simple feature toggle definition
```
    featureToggleBinder(binder)
                        .featureId("featureXX")
                        .bind()
```
This example creates bindings for @Inject
```
    @Inject
    public Runner(@FeatureToggle("featureXX") Supplier<Boolean> isFeatureXXEnabled)
    {
        this.isFeatureXXEnabled = isFeatureXXEnabled;
    }
```
`isFeatureXXEnabled` can be used to test if feature is enabled or disabled:
```
    boolean testFeatureXXEnabled()
    {
        return isFeatureXXEnabled.get();
    }
```

hot reloadable feature toggle definition
```
featureToggleBinder(binder, Feature01.class)
                        .featureId("feature01")
                        .baseClass(Feature01.class)
                        .defaultClass(Feature01Impl01.class)
                        .allOf(Feature01Impl01.class, Feature01Impl02.class)
                        .bind()
```
adding Feature Toggle switching strategy
```
featureToggleBinder(binder)
                        .featureId("feature04")
                        .toggleStrategy("AllowAll")
                        .toggleStrategyConfig(ImmutableMap.of("key", "value", "key2", "value2"))
```

feature-config.properties file example
```
# feature query-logger
feature.query-logger.enabled=true
feature.query-logger.strategy=OsToggle
feature.query-logger.strategy.os_name=.*Linux.*

#feature.query-rate-limiter
feature.query-rate-limiter.currentInstance=com.facebook.presto.server.protocol.QueryBlockingRateLimiter

# feature.query-cancel
feature.query-cancel.strategy=AllowList
feature.query-cancel.strategy.allow-list-source=.*IDEA.*
feature.query-cancel.strategy.allow-list-user=.*prestodb
```
in this example for first feature `query-logger`
changing value of feature.query-logger.enabled to `false` will 'disable' this feature.
Changes will be effective within refresh period.
Pass column delimiter info to reader (prestodb#6338)

Summary: Pull Request resolved: facebookincubator/velox#6338

Reviewed By: Yuhta

Differential Revision: D48457913

fbshipit-source-id: 57d76dfa229de3801bf3181f780a485b628427ad
Memory pool refactoring by removing MemoryPoolBase and ScopedMemoryPool (prestodb#3191)

Summary:
Remove MemoryPoolBase and ScopedMemoryPool, and consolidate into
one memory pool interface MemoryPool and one production implementation
MemoryPoolImp. For the details about the memory pool hierarchy and
ownership see the class comment for MemoryPool.

A query gets the root memory pool object from memory manager by calling
IMemoryManager::getChild(). IMemoryManager is the interface of memory
manger. During the query execution, we calls a parent memory pool's getChild()
to create a child memory pool object.

This PR also changes the references between parent and child memory pool
objects:
1. parent pool object tracks the child pool object through a raw pointer;
2. child pool object holds a shared reference to parent pool object so a parent
    pool object can only destroy after all its child pool objects have been destroyed;
4. child pool object destruction removes its raw pointer tracked in the parent pool
    and release the shared reference on its parent.

Pull Request resolved: facebookincubator/velox#3191

Reviewed By: mbasmanova

Differential Revision: D41206814

Pulled By: xiaoxmeng

fbshipit-source-id: d9ce695c9cf2f558b56c46fc67fd6b7e1c7eac57
branimir-vujicic added a commit to axiomq/presto that referenced this issue Sep 18, 2023
Feature Toggles should allow teams to modify system behavior without changing
code. Feature Toggles are configured using google guice. Basic definition of
toggles are crated using FeatureToggleBinder. FeatureToggleBinder creates
FeatureToggle and additional configuration can be done using feature
configuration.
In current stage Feature Toggles supports:
- if / else based feature toggles
- Dependency Injection based
  Hot reloading implementation without restart require code refactoring to
  add an interface when injecting the new implementation/class
- using various toggle strategies along with simple on / off toggles

configuration:

to allow feature toggle configuration four lines are needed in
config.properties file
```
features.config-source-type=file
features.config-source=/etc/feature-config.properties
features.config-type=properties
features.refresh-period=30s
```

`configuration-source-type` is source type for Feature Toggles configuration
`features.config-source` is a source (file) of the configuration
`features.config-type` format in which configuration is stored (json or properties)
`features.refresh-period` configuration refresh period

Defining Feature Toggles

Feature toggle definition is done in google guice module using `FeatureToggleBinder`

simple feature toggle definition
```
    featureToggleBinder(binder)
                        .featureId("featureXX")
                        .bind()
```
This example creates bindings for @Inject
```
    @Inject
    public Runner(@FeatureToggle("featureXX") Supplier<Boolean> isFeatureXXEnabled)
    {
        this.isFeatureXXEnabled = isFeatureXXEnabled;
    }
```
`isFeatureXXEnabled` can be used to test if feature is enabled or disabled:
```
    boolean testFeatureXXEnabled()
    {
        return isFeatureXXEnabled.get();
    }
```

hot reloadable feature toggle definition
```
featureToggleBinder(binder, Feature01.class)
                        .featureId("feature01")
                        .baseClass(Feature01.class)
                        .defaultClass(Feature01Impl01.class)
                        .allOf(Feature01Impl01.class, Feature01Impl02.class)
                        .bind()
```
adding Feature Toggle switching strategy
```
featureToggleBinder(binder)
                        .featureId("feature04")
                        .toggleStrategy("AllowAll")
                        .toggleStrategyConfig(ImmutableMap.of("key", "value", "key2", "value2"))
```

feature-config.properties file example
```
# feature query-logger
feature.query-logger.enabled=true
feature.query-logger.strategy=OsToggle
feature.query-logger.strategy.os_name=.*Linux.*

#feature.query-rate-limiter
feature.query-rate-limiter.currentInstance=com.facebook.presto.server.protocol.QueryBlockingRateLimiter

# feature.query-cancel
feature.query-cancel.strategy=AllowList
feature.query-cancel.strategy.allow-list-source=.*IDEA.*
feature.query-cancel.strategy.allow-list-user=.*prestodb
```
in this example for first feature `query-logger`
changing value of feature.query-logger.enabled to `false` will 'disable' this feature.
Changes will be effective within refresh period.
Pass column delimiter info to reader (prestodb#6338)

Summary: Pull Request resolved: facebookincubator/velox#6338

Reviewed By: Yuhta

Differential Revision: D48457913

fbshipit-source-id: 57d76dfa229de3801bf3181f780a485b628427ad
Memory pool refactoring by removing MemoryPoolBase and ScopedMemoryPool (prestodb#3191)

Summary:
Remove MemoryPoolBase and ScopedMemoryPool, and consolidate into
one memory pool interface MemoryPool and one production implementation
MemoryPoolImp. For the details about the memory pool hierarchy and
ownership see the class comment for MemoryPool.

A query gets the root memory pool object from memory manager by calling
IMemoryManager::getChild(). IMemoryManager is the interface of memory
manger. During the query execution, we calls a parent memory pool's getChild()
to create a child memory pool object.

This PR also changes the references between parent and child memory pool
objects:
1. parent pool object tracks the child pool object through a raw pointer;
2. child pool object holds a shared reference to parent pool object so a parent
    pool object can only destroy after all its child pool objects have been destroyed;
4. child pool object destruction removes its raw pointer tracked in the parent pool
    and release the shared reference on its parent.

Pull Request resolved: facebookincubator/velox#3191

Reviewed By: mbasmanova

Differential Revision: D41206814

Pulled By: xiaoxmeng

fbshipit-source-id: d9ce695c9cf2f558b56c46fc67fd6b7e1c7eac57
branimir-vujicic added a commit to axiomq/presto that referenced this issue Sep 18, 2023
Feature Toggles should allow teams to modify system behavior without changing
code. Feature Toggles are configured using google guice. Basic definition of
toggles are crated using FeatureToggleBinder. FeatureToggleBinder creates
FeatureToggle and additional configuration can be done using feature
configuration.
In current stage Feature Toggles supports:
- if / else based feature toggles
- Dependency Injection based
  Hot reloading implementation without restart require code refactoring to
  add an interface when injecting the new implementation/class
- using various toggle strategies along with simple on / off toggles

configuration:

to allow feature toggle configuration four lines are needed in
config.properties file
```
features.config-source-type=file
features.config-source=/etc/feature-config.properties
features.config-type=properties
features.refresh-period=30s
```

`configuration-source-type` is source type for Feature Toggles configuration
`features.config-source` is a source (file) of the configuration
`features.config-type` format in which configuration is stored (json or properties)
`features.refresh-period` configuration refresh period

Defining Feature Toggles

Feature toggle definition is done in google guice module using `FeatureToggleBinder`

simple feature toggle definition
```
    featureToggleBinder(binder)
                        .featureId("featureXX")
                        .bind()
```
This example creates bindings for @Inject
```
    @Inject
    public Runner(@FeatureToggle("featureXX") Supplier<Boolean> isFeatureXXEnabled)
    {
        this.isFeatureXXEnabled = isFeatureXXEnabled;
    }
```
`isFeatureXXEnabled` can be used to test if feature is enabled or disabled:
```
    boolean testFeatureXXEnabled()
    {
        return isFeatureXXEnabled.get();
    }
```

hot reloadable feature toggle definition
```
featureToggleBinder(binder, Feature01.class)
                        .featureId("feature01")
                        .baseClass(Feature01.class)
                        .defaultClass(Feature01Impl01.class)
                        .allOf(Feature01Impl01.class, Feature01Impl02.class)
                        .bind()
```
adding Feature Toggle switching strategy
```
featureToggleBinder(binder)
                        .featureId("feature04")
                        .toggleStrategy("AllowAll")
                        .toggleStrategyConfig(ImmutableMap.of("key", "value", "key2", "value2"))
```

feature-config.properties file example
```
# feature query-logger
feature.query-logger.enabled=true
feature.query-logger.strategy=OsToggle
feature.query-logger.strategy.os_name=.*Linux.*

#feature.query-rate-limiter
feature.query-rate-limiter.currentInstance=com.facebook.presto.server.protocol.QueryBlockingRateLimiter

# feature.query-cancel
feature.query-cancel.strategy=AllowList
feature.query-cancel.strategy.allow-list-source=.*IDEA.*
feature.query-cancel.strategy.allow-list-user=.*prestodb
```
in this example for first feature `query-logger`
changing value of feature.query-logger.enabled to `false` will 'disable' this feature.
Changes will be effective within refresh period.
Pass column delimiter info to reader (prestodb#6338)

Summary: Pull Request resolved: facebookincubator/velox#6338

Reviewed By: Yuhta

Differential Revision: D48457913

fbshipit-source-id: 57d76dfa229de3801bf3181f780a485b628427ad
Memory pool refactoring by removing MemoryPoolBase and ScopedMemoryPool (prestodb#3191)

Summary:
Remove MemoryPoolBase and ScopedMemoryPool, and consolidate into
one memory pool interface MemoryPool and one production implementation
MemoryPoolImp. For the details about the memory pool hierarchy and
ownership see the class comment for MemoryPool.

A query gets the root memory pool object from memory manager by calling
IMemoryManager::getChild(). IMemoryManager is the interface of memory
manger. During the query execution, we calls a parent memory pool's getChild()
to create a child memory pool object.

This PR also changes the references between parent and child memory pool
objects:
1. parent pool object tracks the child pool object through a raw pointer;
2. child pool object holds a shared reference to parent pool object so a parent
    pool object can only destroy after all its child pool objects have been destroyed;
4. child pool object destruction removes its raw pointer tracked in the parent pool
    and release the shared reference on its parent.

Pull Request resolved: facebookincubator/velox#3191

Reviewed By: mbasmanova

Differential Revision: D41206814

Pulled By: xiaoxmeng

fbshipit-source-id: d9ce695c9cf2f558b56c46fc67fd6b7e1c7eac57
branimir-vujicic added a commit to axiomq/presto that referenced this issue Sep 18, 2023
Feature Toggles should allow teams to modify system behavior without changing
code. Feature Toggles are configured using google guice. Basic definition of
toggles are crated using FeatureToggleBinder. FeatureToggleBinder creates
FeatureToggle and additional configuration can be done using feature
configuration.
In current stage Feature Toggles supports:
- if / else based feature toggles
- Dependency Injection based
  Hot reloading implementation without restart require code refactoring to
  add an interface when injecting the new implementation/class
- using various toggle strategies along with simple on / off toggles

configuration:

to allow feature toggle configuration four lines are needed in
config.properties file
```
features.config-source-type=file
features.config-source=/etc/feature-config.properties
features.config-type=properties
features.refresh-period=30s
```

`configuration-source-type` is source type for Feature Toggles configuration
`features.config-source` is a source (file) of the configuration
`features.config-type` format in which configuration is stored (json or properties)
`features.refresh-period` configuration refresh period

Defining Feature Toggles

Feature toggle definition is done in google guice module using `FeatureToggleBinder`

simple feature toggle definition
```
    featureToggleBinder(binder)
                        .featureId("featureXX")
                        .bind()
```
This example creates bindings for @Inject
```
    @Inject
    public Runner(@FeatureToggle("featureXX") Supplier<Boolean> isFeatureXXEnabled)
    {
        this.isFeatureXXEnabled = isFeatureXXEnabled;
    }
```
`isFeatureXXEnabled` can be used to test if feature is enabled or disabled:
```
    boolean testFeatureXXEnabled()
    {
        return isFeatureXXEnabled.get();
    }
```

hot reloadable feature toggle definition
```
featureToggleBinder(binder, Feature01.class)
                        .featureId("feature01")
                        .baseClass(Feature01.class)
                        .defaultClass(Feature01Impl01.class)
                        .allOf(Feature01Impl01.class, Feature01Impl02.class)
                        .bind()
```
adding Feature Toggle switching strategy
```
featureToggleBinder(binder)
                        .featureId("feature04")
                        .toggleStrategy("AllowAll")
                        .toggleStrategyConfig(ImmutableMap.of("key", "value", "key2", "value2"))
```

feature-config.properties file example
```
# feature query-logger
feature.query-logger.enabled=true
feature.query-logger.strategy=OsToggle
feature.query-logger.strategy.os_name=.*Linux.*

#feature.query-rate-limiter
feature.query-rate-limiter.currentInstance=com.facebook.presto.server.protocol.QueryBlockingRateLimiter

# feature.query-cancel
feature.query-cancel.strategy=AllowList
feature.query-cancel.strategy.allow-list-source=.*IDEA.*
feature.query-cancel.strategy.allow-list-user=.*prestodb
```
in this example for first feature `query-logger`
changing value of feature.query-logger.enabled to `false` will 'disable' this feature.
Changes will be effective within refresh period.
Pass column delimiter info to reader (prestodb#6338)

Summary: Pull Request resolved: facebookincubator/velox#6338

Reviewed By: Yuhta

Differential Revision: D48457913

fbshipit-source-id: 57d76dfa229de3801bf3181f780a485b628427ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants