You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2011/02/01 23:53:57 UTC

AllowsPassByReference support

Hi,

I'm very surprised (after spending hours of debugging) to find out that a "big" feature is disabled to allow some tests to pass :-(. I would rather that we "ignore" the failing test cases with JIRA tickets so that we won't forget to fix it. 

Anyway, I'm adding code to bring up the allowsPassByReference support back:

1) Add a flag to Reference to indicate if the reference supports "allowsPassByReference". This is introduced by the SCA Java spec.
2) In the ReferenceProcessor to set the flag based on the @AllowsPassByReference annotations at the implementation class or method/field/constructor with @Reference.
3) Re-enable the JavaImplementation to honor the allowsPassByReference for implementation class/methods. (We could consider to promote this flag to service/operation level).
4) Re-enable the check for the SCA binding to use the reference/service allowsPassByReference flag to decide if we can optimize the remotable operations by allowing pass-by-reference.

By the way, where can I find the compliance tests for [JCA20009] and [JCA20010]?

Thanks,
Raymond
________________________________________________________________ 
Raymond Feng
rfeng@apache.org
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On Feb 1, 2011, at 2:43 PM, Luciano Resende wrote:

> On Mon, Mar 1, 2010 at 2:54 PM,  <an...@apache.org> wrote:
>> Author: antelder
>> Date: Mon Mar  1 22:54:24 2010
>> New Revision: 917777
>> 
>> URL: http://svn.apache.org/viewvc?rev=917777&view=rev
>> Log:
>> Fix to ensure pass-by-value is used if only one end is using allowsPassByReference
>> 
>> Modified:
>>    tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
>> 
>> Modified: tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
>> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java?rev=917777&r1=917776&r2=917777&view=diff
>> ==============================================================================
>> --- tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java (original)
>> +++ tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java Mon Mar  1 22:54:24 2010
>> @@ -208,7 +208,8 @@
>>                        passByValue = false;
>>                     }
>>                 } else {
>> -                    boolean allowsPBR = chain.allowsPassByReference();
>> +//                    boolean allowsPBR = chain.allowsPassByReference(); TODO: TUSCANY-3479 this breaks the conformance tests as it needs to consider _both_ ends
>> +                    boolean allowsPBR = false;
>>                     if (allowsPBR && interfaceContractMapper.isCompatibleByReference(operation, targetOp, Compatibility.SUBSET)) {
>>                         passByValue = false;
>>                     } else if (interfaceContractMapper.isCompatibleByValue(operation, targetOp, Compatibility.SUBSET)) {
>> 
>> 
>> 
> 
> 
> This always assume PBV, which will cause extra and unnecessary
> transformation and degrade performance. Instead of hacking the core
> runtime, we should really look into the root cause of the issue and
> fix it. I'd rather really disable the conformance test.
> 
> -- 
> Luciano Resende
> http://people.apache.org/~lresende
> http://twitter.com/lresende1975
> http://lresende.blogspot.com/


Re: AllowsPassByReference support

Posted by ant elder <an...@gmail.com>.
On Wed, Feb 2, 2011 at 12:25 AM, Raymond Feng <en...@gmail.com> wrote:
> Sorry, you seems to be dancing around the "optional" vs "mandatory" terms
> here. I lost a few hours to figure it out that was the root cause of a
> problem I ran into.

I'm not dancing around it i'm trying to be quiet clear - implementing
the mandatory spec features is the most important thing and support
for optional features comes second. It took much much much more than a
few hours to get all the compliance tests passing so i don''t like the
thought of letting them get broken again.

> By my knowledge, we already had support for the allowsPassByReference
> optimization for the service side (the reference side came into the spec at
> later time) before the code was disabled. The feature (even it is optional
> for the spec compliance) is important to the use cases I have because we
> don't want to copy several MBs data. IMHO, Tuscany is not purely just a
> reference implementation of the SCA specs.

Yes its not just a reference impl but if doesn't pass the compliance
tests it would lose a lot of value. Supporting other or optional use
cases is fine too but it needs to fit in with that.

> Anyway, I'm enabling the optimization for both reference and service sides.

As i said in the other email - terrific.

   ...ant

Re: AllowsPassByReference support

Posted by Raymond Feng <en...@gmail.com>.
Sorry, you seems to be dancing around the "optional" vs "mandatory" terms here. I lost a few hours to figure it out that was the root cause of a problem I ran into. 

By my knowledge, we already had support for the allowsPassByReference optimization for the service side (the reference side came into the spec at later time) before the code was disabled. The feature (even it is optional for the spec compliance) is important to the use cases I have because we don't want to copy several MBs data. IMHO, Tuscany is not purely just a reference implementation of the SCA specs. 

Anyway, I'm enabling the optimization for both reference and service sides. 

Thanks,
Raymond 
________________________________________________________________ 
Raymond Feng
rfeng@apache.org
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On Feb 1, 2011, at 4:07 PM, ant elder wrote:

> On Tue, Feb 1, 2011 at 11:46 PM, Luciano Resende <lu...@gmail.com> wrote:
>> On Tue, Feb 1, 2011 at 3:07 PM, Mike Edwards
>> <mi...@gmail.com> wrote:
>>> On 01/02/2011 22:53, Raymond Feng wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I would rather that we "ignore" the failing test cases with JIRA
>>>> tickets so that we won't forget to fix it.
>>> 
>>> Raymond,
>>> 
>>> On that point, at this stage, I totally disagree.
>>> 
>>> Fix the function so that it passes the tests BEFORE putting it back in.
>>> 
>> 
>> +1, I believe this exactly what Raymond said.
>> 
>>> I will be very disappointed if I find more OASIS conformance tests
>>> failing...
>>> 
>>> 
>> 
>> To this matter, if we disable a functionality in the runtime, to
>> "fake" a conformace test is passing is NO good either.
>> 
> 
> Did you two get out of the wrong side of your beds today?
> 
> The runtime is not "faking" any conformance test passing its doing it
> quite correctly as per section 2.3.4 of the Java CAA specification.
> Optimizing remotable calls marked with allows-pass-by-reference is an
> optional feature and its quite valid to not do any optimization in
> some/any circumstances. I agree with Mike that its much more important
> for Tuscany to maintain conformance with the mandatory features of the
> specs and keep the compliance tests passing. If you want to enhance
> the allows-pass-by-reference optimization support thats terrific too.
> 
>   ...ant


Re: AllowsPassByReference support

Posted by ant elder <an...@gmail.com>.
On Tue, Feb 1, 2011 at 11:46 PM, Luciano Resende <lu...@gmail.com> wrote:
> On Tue, Feb 1, 2011 at 3:07 PM, Mike Edwards
> <mi...@gmail.com> wrote:
>> On 01/02/2011 22:53, Raymond Feng wrote:
>>>
>>> Hi,
>>>
>>> I would rather that we "ignore" the failing test cases with JIRA
>>> tickets so that we won't forget to fix it.
>>
>> Raymond,
>>
>> On that point, at this stage, I totally disagree.
>>
>> Fix the function so that it passes the tests BEFORE putting it back in.
>>
>
> +1, I believe this exactly what Raymond said.
>
>> I will be very disappointed if I find more OASIS conformance tests
>> failing...
>>
>>
>
> To this matter, if we disable a functionality in the runtime, to
> "fake" a conformace test is passing is NO good either.
>

Did you two get out of the wrong side of your beds today?

The runtime is not "faking" any conformance test passing its doing it
quite correctly as per section 2.3.4 of the Java CAA specification.
Optimizing remotable calls marked with allows-pass-by-reference is an
optional feature and its quite valid to not do any optimization in
some/any circumstances. I agree with Mike that its much more important
for Tuscany to maintain conformance with the mandatory features of the
specs and keep the compliance tests passing. If you want to enhance
the allows-pass-by-reference optimization support thats terrific too.

   ...ant

Re: AllowsPassByReference support

Posted by Luciano Resende <lu...@gmail.com>.
On Tue, Feb 1, 2011 at 3:07 PM, Mike Edwards
<mi...@gmail.com> wrote:
> On 01/02/2011 22:53, Raymond Feng wrote:
>>
>> Hi,
>>
>> I would rather that we "ignore" the failing test cases with JIRA
>> tickets so that we won't forget to fix it.
>
> Raymond,
>
> On that point, at this stage, I totally disagree.
>
> Fix the function so that it passes the tests BEFORE putting it back in.
>

+1, I believe this exactly what Raymond said.

> I will be very disappointed if I find more OASIS conformance tests
> failing...
>
>

To this matter, if we disable a functionality in the runtime, to
"fake" a conformace test is passing is NO good either.


-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: AllowsPassByReference support

Posted by Raymond Feng <en...@gmail.com>.
I'm not sure if you misunderstood my point :-)

I meant to say when we found broken functions in Tuscany that fail the test cases, we should track the failures instead of disabling the code path to fool the test cases. I just don't want to see that we cheat ourselves (if so, we can set the surefire skip flag to get all the tests passing :-(

Back to now, I'm trying to fix the underlying issues so that we can REALLY get the test cases passing. I guess that's what you would like to see.

Thanks,
Raymond
________________________________________________________________ 
Raymond Feng
rfeng@apache.org
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On Feb 1, 2011, at 3:07 PM, Mike Edwards wrote:

> On 01/02/2011 22:53, Raymond Feng wrote:
>> Hi,
>> 
>> I would rather that we "ignore" the failing test cases with JIRA
>> tickets so that we won't forget to fix it.
> Raymond,
> 
> On that point, at this stage, I totally disagree.
> 
> Fix the function so that it passes the tests BEFORE putting it back in.
> 
> I will be very disappointed if I find more OASIS conformance tests failing...
> 
> 
> Yours,  Mike.


Re: AllowsPassByReference support

Posted by Mike Edwards <mi...@gmail.com>.
On 01/02/2011 22:53, Raymond Feng wrote:
> Hi,
>
> I would rather that we "ignore" the failing test cases with JIRA
> tickets so that we won't forget to fix it.
Raymond,

On that point, at this stage, I totally disagree.

Fix the function so that it passes the tests BEFORE putting it back in.

I will be very disappointed if I find more OASIS conformance tests failing...


Yours,  Mike.

Re: AllowsPassByReference support

Posted by ant elder <an...@gmail.com>.
On Tue, Feb 1, 2011 at 10:53 PM, Raymond Feng <en...@gmail.com> wrote:

> By the way, where can I find the compliance tests forĀ [JCA20009]
> andĀ [JCA20010]?

You need to look in the test assertions spec to get the assertion
number and then in the testcases spec to get the test case number, for
those two its JCA_2009_TestCase and JCA_2010_TestCase. You can run
just those two tests from in testing\compliance-tests\java-caa with:

mvn -Dtest=JCA_2009_TestCase,JCA_2010_TestCase

   ...ant