You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/07/16 21:51:08 UTC

[GitHub] [brooklyn-server] ahgittin opened a new pull request #1205: Be stricter about java lambdas in data which is persisted

ahgittin opened a new pull request #1205:
URL: https://github.com/apache/brooklyn-server/pull/1205


   It has always been a bad idea but previously we have allowed it.  This causes obscure but horrible problems in many cases:
   
   * lambdas which don't implement Serializable are written by xstream as `null`, and read back as null, with no warning
   * lambdas which do implement Serializable might be okay written by xstream but might not, and can be read differently or not at all by different JVMs, and are even more brittle than inner classes
   
   This PR causes us to be stricter about persisting lambdas e.g. within a config key or part of an effector so that we fail fast.
   
   Default is to FAIL if we attempt to write one which will be treated as null, and WARN otherwise.  This can be configured in brooklyn.cfg using the keys in LambdaPreventionMapper.
   
   In addition this adds a delta-persistence synchronously as part of application/entity creation, so if a problem is detected the creation will fail.  Things are unmanaged now if creation fails.
   
   Internally there is more work done and more API methods to get access to failures during persistence.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] iuliana merged pull request #1205: Be stricter about java lambdas in data which is persisted

Posted by GitBox <gi...@apache.org>.
iuliana merged pull request #1205:
URL: https://github.com/apache/brooklyn-server/pull/1205


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] iuliana merged pull request #1205: Be stricter about java lambdas in data which is persisted

Posted by GitBox <gi...@apache.org>.
iuliana merged pull request #1205:
URL: https://github.com/apache/brooklyn-server/pull/1205


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] iuliana commented on pull request #1205: Be stricter about java lambdas in data which is persisted

Posted by GitBox <gi...@apache.org>.
iuliana commented on pull request #1205:
URL: https://github.com/apache/brooklyn-server/pull/1205#issuecomment-883299373


   This passed locally with tests. I will merge it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] iuliana commented on pull request #1205: Be stricter about java lambdas in data which is persisted

Posted by GitBox <gi...@apache.org>.
iuliana commented on pull request #1205:
URL: https://github.com/apache/brooklyn-server/pull/1205#issuecomment-883299373


   This passed locally with tests. I will merge it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] ahgittin commented on pull request #1205: Be stricter about java lambdas in data which is persisted

Posted by GitBox <gi...@apache.org>.
ahgittin commented on pull request #1205:
URL: https://github.com/apache/brooklyn-server/pull/1205#issuecomment-883234527


   was pointed out that this breaks on OSGi with
   
   ```
   org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=brooklyn-software-winrm; type=karaf.feature; version=0; filter:="(&(osgi.identity=brooklyn-software-winrm)(type=karaf.feature)(version>=0.0.0))" [caused by: Unable to resolve brooklyn-software-winrm/1.1.0.SNAPSHOT: missing requirement [brooklyn-software-winrm/1.1.0.SNAPSHOT] osgi.identity; osgi.identity=org.apache.brooklyn.software-winrm; type=osgi.bundle; version="[1.1.0.SNAPSHOT,1.1.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.brooklyn.software-winrm/1.1.0.SNAPSHOT: missing requirement [org.apache.brooklyn.software-winrm/1.1.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.brooklyn.core.config)(version>=1.1.0)(!(version>=2.0.0)))" [caused by: Unable to resolve org.apache.brooklyn.core/1.1.0.SNAPSHOT: missing requirement [org.apache.brooklyn.core/1.1.0.SNAPSHOT] osgi.wiring.package; filter:="(o
 sgi.wiring.package=com.thoughtworks.xstream.core.util)"]]]
   ```
   
   last commit should fix that
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] ahgittin commented on pull request #1205: Be stricter about java lambdas in data which is persisted

Posted by GitBox <gi...@apache.org>.
ahgittin commented on pull request #1205:
URL: https://github.com/apache/brooklyn-server/pull/1205#issuecomment-883234527


   was pointed out that this breaks on OSGi with
   
   ```
   org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=brooklyn-software-winrm; type=karaf.feature; version=0; filter:="(&(osgi.identity=brooklyn-software-winrm)(type=karaf.feature)(version>=0.0.0))" [caused by: Unable to resolve brooklyn-software-winrm/1.1.0.SNAPSHOT: missing requirement [brooklyn-software-winrm/1.1.0.SNAPSHOT] osgi.identity; osgi.identity=org.apache.brooklyn.software-winrm; type=osgi.bundle; version="[1.1.0.SNAPSHOT,1.1.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.brooklyn.software-winrm/1.1.0.SNAPSHOT: missing requirement [org.apache.brooklyn.software-winrm/1.1.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.brooklyn.core.config)(version>=1.1.0)(!(version>=2.0.0)))" [caused by: Unable to resolve org.apache.brooklyn.core/1.1.0.SNAPSHOT: missing requirement [org.apache.brooklyn.core/1.1.0.SNAPSHOT] osgi.wiring.package; filter:="(o
 sgi.wiring.package=com.thoughtworks.xstream.core.util)"]]]
   ```
   
   last commit should fix that
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] ahgittin commented on pull request #1205: Be stricter about java lambdas in data which is persisted

Posted by GitBox <gi...@apache.org>.
ahgittin commented on pull request #1205:
URL: https://github.com/apache/brooklyn-server/pull/1205#issuecomment-883234527


   was pointed out that this breaks on OSGi with
   
   ```
   org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=brooklyn-software-winrm; type=karaf.feature; version=0; filter:="(&(osgi.identity=brooklyn-software-winrm)(type=karaf.feature)(version>=0.0.0))" [caused by: Unable to resolve brooklyn-software-winrm/1.1.0.SNAPSHOT: missing requirement [brooklyn-software-winrm/1.1.0.SNAPSHOT] osgi.identity; osgi.identity=org.apache.brooklyn.software-winrm; type=osgi.bundle; version="[1.1.0.SNAPSHOT,1.1.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.brooklyn.software-winrm/1.1.0.SNAPSHOT: missing requirement [org.apache.brooklyn.software-winrm/1.1.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.brooklyn.core.config)(version>=1.1.0)(!(version>=2.0.0)))" [caused by: Unable to resolve org.apache.brooklyn.core/1.1.0.SNAPSHOT: missing requirement [org.apache.brooklyn.core/1.1.0.SNAPSHOT] osgi.wiring.package; filter:="(o
 sgi.wiring.package=com.thoughtworks.xstream.core.util)"]]]
   ```
   
   last commit should fix that
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org