You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/08/28 14:05:17 UTC

[GitHub] [ignite] zstan opened a new pull request #8195: IGNITE-13389

zstan opened a new pull request #8195:
URL: https://github.com/apache/ignite/pull/8195


   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


----------------------------------------------------------------
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.

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



[GitHub] [ignite] zstan commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
zstan commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r482720544



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
##########
@@ -6411,7 +6411,14 @@ else if (newSysTtl == CU.TTL_ZERO) {
                 CacheLazyEntry<Object, Object> interceptEntry =
                     new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null, keepBinary);
 
-                Object interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);
+                Object interceptorVal = null;
+
+                try {
+                    interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);

Review comment:
       does question still actual ?




----------------------------------------------------------------
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.

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



[GitHub] [ignite] vldpyatkov commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
vldpyatkov commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r481060952



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
##########
@@ -6411,7 +6411,14 @@ else if (newSysTtl == CU.TTL_ZERO) {
                 CacheLazyEntry<Object, Object> interceptEntry =
                     new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null, keepBinary);
 
-                Object interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);
+                Object interceptorVal = null;
+
+                try {
+                    interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);

Review comment:
       Ok. Does here be an exception logic?




----------------------------------------------------------------
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.

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



[GitHub] [ignite] ptupitsyn commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r485367430



##########
File path: modules/core/src/main/java/org/apache/ignite/configuration/DistibutedThinClientConfiguration.java
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import static org.apache.ignite.internal.cluster.DistributedConfigurationUtils.makeUpdateListener;
+import static org.apache.ignite.internal.processors.configuration.distributed.DistributedBooleanProperty.detachedBooleanProperty;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedChangeableProperty;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher;
+import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Thin client distributed configuration.
+ */
+public class DistibutedThinClientConfiguration {
+    /** */
+    private final IgniteLogger log;
+
+    /** . */
+    private final DistributedChangeableProperty<Boolean> showStackTrace =
+        detachedBooleanProperty("thinClientProperty.showStackTrace");
+
+    /** Message of baseline auto-adjust parameter was changed. */
+    private static final String PROPERTY_UPDATE_MESSAGE =
+        "ThinClientProperty parameter '%s' was changed from '%s' to '%s'";
+
+    /**
+     * @param ctx Kernal context.
+     */
+    public DistibutedThinClientConfiguration(
+        GridKernalContext ctx
+    ) {
+        log = ctx.log(DistibutedThinClientConfiguration.class);
+
+        GridInternalSubscriptionProcessor isp = ctx.internalSubscriptionProcessor();
+
+        isp.registerDistributedConfigurationListener(
+            new DistributedConfigurationLifecycleListener() {
+                @Override public void onReadyToRegister(DistributedPropertyDispatcher dispatcher) {
+                    showStackTrace.addListener(makeUpdateListener(PROPERTY_UPDATE_MESSAGE, log));
+
+                    dispatcher.registerProperties(showStackTrace);
+                }
+            }
+        );
+    }
+
+    /**
+     * @param showStack If {@code true} shows full stack trace on the client side.
+     */
+    public GridFutureAdapter<?> updateThinClientShowStackTraceAsync(boolean showStack) throws IgniteCheckedException {
+        return showStackTrace.propagateAsync(showStack);
+    }
+
+    /**
+     * @return If {@code true} shows full stack trace on the client side.
+     */
+    @Nullable public Boolean showFullStack() {

Review comment:
       @zstan please see above:
   
   > Let's rename this to `sendServerExceptionStackTraceToClient`




----------------------------------------------------------------
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.

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



[GitHub] [ignite] vldpyatkov commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
vldpyatkov commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r481060952



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
##########
@@ -6411,7 +6411,14 @@ else if (newSysTtl == CU.TTL_ZERO) {
                 CacheLazyEntry<Object, Object> interceptEntry =
                     new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null, keepBinary);
 
-                Object interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);
+                Object interceptorVal = null;
+
+                try {
+                    interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);

Review comment:
       Ok. Does here be exception logic?




----------------------------------------------------------------
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.

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



[GitHub] [ignite] zstan commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
zstan commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r482731824



##########
File path: modules/core/src/main/java/org/apache/ignite/configuration/DistibutedThinClientConfiguration.java
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import static org.apache.ignite.internal.cluster.DistributedConfigurationUtils.makeUpdateListener;
+import static org.apache.ignite.internal.processors.configuration.distributed.DistributedBooleanProperty.detachedBooleanProperty;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedChangeableProperty;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher;
+import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Thin client distributed configuration.
+ */
+public class DistibutedThinClientConfiguration {
+    /** */
+    private final IgniteLogger log;
+
+    /** . */
+    private final DistributedChangeableProperty<Boolean> showStackTrace =
+        detachedBooleanProperty("thinClientProperty.showStackTrace");
+
+    /** Message of baseline auto-adjust parameter was changed. */
+    private static final String PROPERTY_UPDATE_MESSAGE =
+        "ThinClientProperty parameter '%s' was changed from '%s' to '%s'";
+
+    /**
+     * @param ctx Kernal context.
+     */
+    public DistibutedThinClientConfiguration(
+        GridKernalContext ctx
+    ) {
+        log = ctx.log(DistibutedThinClientConfiguration.class);
+
+        GridInternalSubscriptionProcessor isp = ctx.internalSubscriptionProcessor();
+
+        isp.registerDistributedConfigurationListener(
+            new DistributedConfigurationLifecycleListener() {
+                @Override public void onReadyToRegister(DistributedPropertyDispatcher dispatcher) {
+                    showStackTrace.addListener(makeUpdateListener(PROPERTY_UPDATE_MESSAGE, log));
+
+                    dispatcher.registerProperties(showStackTrace);
+                }
+            }
+        );
+    }
+
+    /**
+     * @param showStack If {@code true} shows full stack trace on the client side.
+     */
+    public GridFutureAdapter<?> updateThinClientShowStackTraceAsync(boolean showStack) throws IgniteCheckedException {
+        return showStackTrace.propagateAsync(showStack);
+    }
+
+    /**
+     * @return If {@code true} shows full stack trace on the client side.
+     */
+    @Nullable public Boolean showFullStack() {

Review comment:
       1. I disagree here, we have two type of setting for now: static and dynamic, dynamic has upper priority if dynamic unset - use static.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] ptupitsyn commented on pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#issuecomment-1042971109


   Superseded by #9824 


-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] zstan commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
zstan commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r481049406



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java
##########
@@ -646,5 +650,19 @@ private static boolean isNotDefault(ClientConnectorConfiguration cliConnCfg) {
 
             return false;
         }
+
+        /** {@inheritDoc} */
+        @Override public void showFullStack(boolean show) {
+            IgniteCompute compute = ctx.grid().compute(ctx.grid().cluster().forServers());
+
+            compute.broadcast(new CA() {

Review comment:
       got it !

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java
##########
@@ -115,7 +116,14 @@
         int status = e instanceof IgniteClientException ?
             ((IgniteClientException)e).statusCode() : ClientStatus.FAILED;
 
-        return new ClientResponse(req.requestId(), status, e.getMessage());
+        boolean fullStack = false;
+
+        if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) {

Review comment:
       In ideal - i like idea to show only one error message and probably error code, thus i prefer to store this logic where it possible.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java
##########
@@ -115,7 +116,14 @@
         int status = e instanceof IgniteClientException ?
             ((IgniteClientException)e).statusCode() : ClientStatus.FAILED;
 
-        return new ClientResponse(req.requestId(), status, e.getMessage());
+        boolean fullStack = false;
+
+        if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) {
+            fullStack =
+                ctx.kernalContext().config().getClientConnectorConfiguration().getThinClientConfiguration().showFullStack();

Review comment:
       cause it can be changed through jmx.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] zstan commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
zstan commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r481042711



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
##########
@@ -6411,7 +6411,14 @@ else if (newSysTtl == CU.TTL_ZERO) {
                 CacheLazyEntry<Object, Object> interceptEntry =
                     new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null, keepBinary);
 
-                Object interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);
+                Object interceptorVal = null;
+
+                try {
+                    interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);

Review comment:
       you are right, without this fix we could obtain erroneous CorruptedTreeException i want to fix it here too.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] ptupitsyn commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r482763305



##########
File path: modules/core/src/main/java/org/apache/ignite/configuration/DistibutedThinClientConfiguration.java
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import static org.apache.ignite.internal.cluster.DistributedConfigurationUtils.makeUpdateListener;
+import static org.apache.ignite.internal.processors.configuration.distributed.DistributedBooleanProperty.detachedBooleanProperty;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedChangeableProperty;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher;
+import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Thin client distributed configuration.
+ */
+public class DistibutedThinClientConfiguration {
+    /** */
+    private final IgniteLogger log;
+
+    /** . */
+    private final DistributedChangeableProperty<Boolean> showStackTrace =
+        detachedBooleanProperty("thinClientProperty.showStackTrace");
+
+    /** Message of baseline auto-adjust parameter was changed. */
+    private static final String PROPERTY_UPDATE_MESSAGE =
+        "ThinClientProperty parameter '%s' was changed from '%s' to '%s'";
+
+    /**
+     * @param ctx Kernal context.
+     */
+    public DistibutedThinClientConfiguration(
+        GridKernalContext ctx
+    ) {
+        log = ctx.log(DistibutedThinClientConfiguration.class);
+
+        GridInternalSubscriptionProcessor isp = ctx.internalSubscriptionProcessor();
+
+        isp.registerDistributedConfigurationListener(
+            new DistributedConfigurationLifecycleListener() {
+                @Override public void onReadyToRegister(DistributedPropertyDispatcher dispatcher) {
+                    showStackTrace.addListener(makeUpdateListener(PROPERTY_UPDATE_MESSAGE, log));
+
+                    dispatcher.registerProperties(showStackTrace);
+                }
+            }
+        );
+    }
+
+    /**
+     * @param showStack If {@code true} shows full stack trace on the client side.
+     */
+    public GridFutureAdapter<?> updateThinClientShowStackTraceAsync(boolean showStack) throws IgniteCheckedException {
+        return showStackTrace.propagateAsync(showStack);
+    }
+
+    /**
+     * @return If {@code true} shows full stack trace on the client side.
+     */
+    @Nullable public Boolean showFullStack() {

Review comment:
       1. I don't understand the need to make this dynamic.
   2. It does not seem to be possible to configure this statically at all.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] ptupitsyn commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r485367245



##########
File path: modules/core/src/main/java/org/apache/ignite/configuration/DistibutedThinClientConfiguration.java
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import static org.apache.ignite.internal.cluster.DistributedConfigurationUtils.makeUpdateListener;
+import static org.apache.ignite.internal.processors.configuration.distributed.DistributedBooleanProperty.detachedBooleanProperty;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedChangeableProperty;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher;
+import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Thin client distributed configuration.
+ */
+public class DistibutedThinClientConfiguration {
+    /** */
+    private final IgniteLogger log;
+
+    /** . */
+    private final DistributedChangeableProperty<Boolean> showStackTrace =
+        detachedBooleanProperty("thinClientProperty.showStackTrace");
+
+    /** Message of baseline auto-adjust parameter was changed. */
+    private static final String PROPERTY_UPDATE_MESSAGE =
+        "ThinClientProperty parameter '%s' was changed from '%s' to '%s'";
+
+    /**
+     * @param ctx Kernal context.
+     */
+    public DistibutedThinClientConfiguration(
+        GridKernalContext ctx
+    ) {
+        log = ctx.log(DistibutedThinClientConfiguration.class);
+
+        GridInternalSubscriptionProcessor isp = ctx.internalSubscriptionProcessor();
+
+        isp.registerDistributedConfigurationListener(
+            new DistributedConfigurationLifecycleListener() {
+                @Override public void onReadyToRegister(DistributedPropertyDispatcher dispatcher) {
+                    showStackTrace.addListener(makeUpdateListener(PROPERTY_UPDATE_MESSAGE, log));
+
+                    dispatcher.registerProperties(showStackTrace);
+                }
+            }
+        );
+    }
+
+    /**
+     * @param showStack If {@code true} shows full stack trace on the client side.
+     */
+    public GridFutureAdapter<?> updateThinClientShowStackTraceAsync(boolean showStack) throws IgniteCheckedException {
+        return showStackTrace.propagateAsync(showStack);
+    }
+
+    /**
+     * @return If {@code true} shows full stack trace on the client side.
+     */
+    @Nullable public Boolean showFullStack() {

Review comment:
       I was wrong - it is possible to configure statically. No objections.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] ptupitsyn commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r482235345



##########
File path: modules/core/src/main/java/org/apache/ignite/configuration/DistibutedThinClientConfiguration.java
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import static org.apache.ignite.internal.cluster.DistributedConfigurationUtils.makeUpdateListener;
+import static org.apache.ignite.internal.processors.configuration.distributed.DistributedBooleanProperty.detachedBooleanProperty;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedChangeableProperty;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher;
+import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Thin client distributed configuration.
+ */
+public class DistibutedThinClientConfiguration {
+    /** */
+    private final IgniteLogger log;
+
+    /** . */
+    private final DistributedChangeableProperty<Boolean> showStackTrace =
+        detachedBooleanProperty("thinClientProperty.showStackTrace");
+
+    /** Message of baseline auto-adjust parameter was changed. */
+    private static final String PROPERTY_UPDATE_MESSAGE =
+        "ThinClientProperty parameter '%s' was changed from '%s' to '%s'";
+
+    /**
+     * @param ctx Kernal context.
+     */
+    public DistibutedThinClientConfiguration(
+        GridKernalContext ctx
+    ) {
+        log = ctx.log(DistibutedThinClientConfiguration.class);
+
+        GridInternalSubscriptionProcessor isp = ctx.internalSubscriptionProcessor();
+
+        isp.registerDistributedConfigurationListener(
+            new DistributedConfigurationLifecycleListener() {
+                @Override public void onReadyToRegister(DistributedPropertyDispatcher dispatcher) {
+                    showStackTrace.addListener(makeUpdateListener(PROPERTY_UPDATE_MESSAGE, log));
+
+                    dispatcher.registerProperties(showStackTrace);
+                }
+            }
+        );
+    }
+
+    /**
+     * @param showStack If {@code true} shows full stack trace on the client side.
+     */
+    public GridFutureAdapter<?> updateThinClientShowStackTraceAsync(boolean showStack) throws IgniteCheckedException {
+        return showStackTrace.propagateAsync(showStack);
+    }
+
+    /**
+     * @return If {@code true} shows full stack trace on the client side.
+     */
+    @Nullable public Boolean showFullStack() {

Review comment:
       1. This property should be in the existing `ThinClientConfiguration` class. Another configuration class is not needed.
   2. Let's rename this to `sendServerExceptionStackTraceToClient`
   3. Please make the javadoc more detailed, something like this:
   ```
   If {@code true}, thin client response will include full stack trace when exception occurs. When {@code false}, only top level exception message is included.
   ```

##########
File path: modules/core/src/main/java/org/apache/ignite/configuration/DistibutedThinClientConfiguration.java
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import static org.apache.ignite.internal.cluster.DistributedConfigurationUtils.makeUpdateListener;
+import static org.apache.ignite.internal.processors.configuration.distributed.DistributedBooleanProperty.detachedBooleanProperty;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedChangeableProperty;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener;
+import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher;
+import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Thin client distributed configuration.
+ */
+public class DistibutedThinClientConfiguration {

Review comment:
       Typo: `Distibuted`

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java
##########
@@ -115,7 +116,14 @@
         int status = e instanceof IgniteClientException ?
             ((IgniteClientException)e).statusCode() : ClientStatus.FAILED;
 
-        return new ClientResponse(req.requestId(), status, e.getMessage());
+        boolean fullStack = false;
+
+        if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) {
+            fullStack =
+                ctx.kernalContext().sqlListener().showFullStackOnClientSide();
+        }
+
+        return new ClientResponse(req.requestId(), status, fullStack ? X.getFullStackTrace(e) : e.getMessage());

Review comment:
       I think the first line should always be the same - `e.getMessage()`. When stack traces are enabled, append stack trace after a newline separator.

##########
File path: modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cluster/ClientClusterTests.cs
##########
@@ -199,7 +199,7 @@ public void TestInvalidCacheNameTriggersIgniteClientException()
             const string invalidCacheName = "invalidCacheName";
             TestDelegate action = () => GetClientCluster().EnableWal(invalidCacheName);
             var ex = Assert.Throws<IgniteClientException>(action);
-            Assert.AreEqual("Cache doesn't exist: " + invalidCacheName, ex.Message);
+            StringAssert.Contains("Cache doesn't exist: " + invalidCacheName, ex.Message);

Review comment:
       We did not enable stack traces for this test (and below), so existing behavior should remain unchanged. Please adjust the logic and revert assertion changes in .NET tests.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] ptupitsyn closed pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
ptupitsyn closed pull request #8195:
URL: https://github.com/apache/ignite/pull/8195


   


-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] vldpyatkov commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
vldpyatkov commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r481058772



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java
##########
@@ -115,7 +116,14 @@
         int status = e instanceof IgniteClientException ?
             ((IgniteClientException)e).statusCode() : ClientStatus.FAILED;
 
-        return new ClientResponse(req.requestId(), status, e.getMessage());
+        boolean fullStack = false;
+
+        if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) {
+            fullStack =
+                ctx.kernalContext().config().getClientConnectorConfiguration().getThinClientConfiguration().showFullStack();

Review comment:
       I know it, but I do not recommend to change static configuration.
   Can you add a specific volatile flag in the ClientRequestHandler and update directly it thought JMX?

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java
##########
@@ -115,7 +116,14 @@
         int status = e instanceof IgniteClientException ?
             ((IgniteClientException)e).statusCode() : ClientStatus.FAILED;
 
-        return new ClientResponse(req.requestId(), status, e.getMessage());
+        boolean fullStack = false;
+
+        if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) {

Review comment:
       What does the condition (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) mean?




----------------------------------------------------------------
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.

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



[GitHub] [ignite] vldpyatkov commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
vldpyatkov commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r481002743



##########
File path: modules/core/src/test/java/org/apache/ignite/client/IgniteBinaryTest.java
##########
@@ -21,27 +21,36 @@
 import java.util.Collection;
 import java.util.Map;
 import java.util.stream.Collectors;
+import javax.cache.Cache;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteBinary;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.binary.BinaryObjectBuilder;
 import org.apache.ignite.binary.BinaryType;
+import org.apache.ignite.cache.CacheInterceptorAdapter;
 import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.odbc.ClientListenerProcessor;
+import org.apache.ignite.internal.util.typedef.X;
+import org.apache.ignite.mxbean.ClientProcessorMXBean;
 import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.testframework.LogListener;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.Timeout;
 
 import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
 
 /**
  * Ignite {@link BinaryObject} API system tests.
  */
-public class IgniteBinaryTest {
+public class IgniteBinaryTest extends GridCommonAbstractTest {
     /** Per test timeout */
     @Rule
     public Timeout globalTimeout = new Timeout((int) GridTestUtils.DFLT_TEST_TIMEOUT);

Review comment:
       If you extend GridCommonAbstractTest, which means a timeout already defined.
   It does not need to use another @Rule for this.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java
##########
@@ -646,5 +650,19 @@ private static boolean isNotDefault(ClientConnectorConfiguration cliConnCfg) {
 
             return false;
         }
+
+        /** {@inheritDoc} */
+        @Override public void showFullStack(boolean show) {
+            IgniteCompute compute = ctx.grid().compute(ctx.grid().cluster().forServers());
+
+            compute.broadcast(new CA() {

Review comment:
       Sending of non-static class over the network leads to serialization of a parent class.
   Please, make it static.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java
##########
@@ -115,7 +116,14 @@
         int status = e instanceof IgniteClientException ?
             ((IgniteClientException)e).statusCode() : ClientStatus.FAILED;
 
-        return new ClientResponse(req.requestId(), status, e.getMessage());
+        boolean fullStack = false;
+
+        if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) {
+            fullStack =
+                ctx.kernalContext().config().getClientConnectorConfiguration().getThinClientConfiguration().showFullStack();

Review comment:
       Why don't you want to do this in constructor?
   I see you use static configuration as a dynamic, but I think it doesn't right too.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
##########
@@ -6411,7 +6411,14 @@ else if (newSysTtl == CU.TTL_ZERO) {
                 CacheLazyEntry<Object, Object> interceptEntry =
                     new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null, keepBinary);
 
-                Object interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);
+                Object interceptorVal = null;
+
+                try {
+                    interceptorVal = cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);

Review comment:
       How this change connected with the ticket?

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java
##########
@@ -115,7 +116,14 @@
         int status = e instanceof IgniteClientException ?
             ((IgniteClientException)e).statusCode() : ClientStatus.FAILED;
 
-        return new ClientResponse(req.requestId(), status, e.getMessage());
+        boolean fullStack = false;
+
+        if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) {

Review comment:
       This is a suspicion condition, may we shall print stack always.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] zstan commented on a change in pull request #8195: IGNITE-13389

Posted by GitBox <gi...@apache.org>.
zstan commented on a change in pull request #8195:
URL: https://github.com/apache/ignite/pull/8195#discussion_r481052598



##########
File path: modules/core/src/test/java/org/apache/ignite/client/IgniteBinaryTest.java
##########
@@ -21,27 +21,36 @@
 import java.util.Collection;
 import java.util.Map;
 import java.util.stream.Collectors;
+import javax.cache.Cache;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteBinary;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.binary.BinaryObjectBuilder;
 import org.apache.ignite.binary.BinaryType;
+import org.apache.ignite.cache.CacheInterceptorAdapter;
 import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.odbc.ClientListenerProcessor;
+import org.apache.ignite.internal.util.typedef.X;
+import org.apache.ignite.mxbean.ClientProcessorMXBean;
 import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.testframework.LogListener;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.Timeout;
 
 import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
 
 /**
  * Ignite {@link BinaryObject} API system tests.
  */
-public class IgniteBinaryTest {
+public class IgniteBinaryTest extends GridCommonAbstractTest {
     /** Per test timeout */
     @Rule
     public Timeout globalTimeout = new Timeout((int) GridTestUtils.DFLT_TEST_TIMEOUT);

Review comment:
       got 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.

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