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
WFLY-10009 Introduce a maximum-timeout management model attribute #11440
Conversation
@ServerSetup({MaximumTimeoutTestCase.TimeoutSetup.class}) | ||
public class MaximumTimeoutTestCase { | ||
|
||
private static final String MESSAGE_REGEX = ".*\\bWARN\\b.*WFLYTX0039: The transaction timeout has been set to %d while the value is 0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like matching messages in a test as it's fragile. If it's necessary though we should only be matching the id. This would break with any internationalized languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, we should just match on the ID if anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having looked at this test more it seems meaningful to verify the two options in this integration test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main issue is once translated interfaces are introduced this would break for anyone running the test with a translated local, e.g. fr
. A pattern validating the number is okay, but we shouldn't use the English text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that even the case for tests? Do we run localized tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue will show up in EAP where we do introduce localization. While CI should continue to work anyone building locally with a locale that's been translated will see this test fail. For example anyone in France with a French locale will see this test fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will push a change
@@ -250,4 +250,7 @@ | |||
@Message(id = 38, value = "Unexpected error on suspending transaction for work %s") | |||
RuntimeException cannotSuspendInflowTransactionUnexpectedError(Work txn, @Cause Exception e); | |||
|
|||
@LogMessage(level = WARN) | |||
@Message(id = 39, value = "The transaction timeout has been set to %s while the value is 0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really user I understand this message. Specifically "while the value is 0".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nor do I, @zhfeng can you take a look please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jamezp @tomjenkinson This message is warning the user that the transaction timeout can not be set to "0" and will replace with the maximum-timeout attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhfeng Those attributes should probably be listed then. Just so it's clear for the user.
@@ -34,6 +34,7 @@ transactions.enable-statistics=Whether transaction statistics should be gathered | |||
transactions.enable-statistics.deprecated=Use statistics-enabled. | |||
transactions.enable-tsm-status=Whether the transaction status manager (TSM) service, needed for out of process recovery, should be provided or not. | |||
transactions.default-timeout=The default timeout for a transaction managed by the transaction manager. | |||
transactions.maximum-timeout=The maximum timeout for a transaction managed by the transaction manager. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may need to be a bit more verbose. It looks like this value is only used if the default-timeout
is set to 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will change this description to make it clear.
@@ -298,6 +315,7 @@ private ModelNode createReadAttributeOperation(String name) { | |||
modelNode.get(TransactionSubsystemRootResourceDefinition.JOURNAL_STORE_ENABLE_ASYNC_IO.getName()).set(true); | |||
modelNode.get(TransactionSubsystemRootResourceDefinition.USE_HORNETQ_STORE.getName()).set(true); | |||
modelNode.get(TransactionSubsystemRootResourceDefinition.USE_JOURNAL_STORE.getName()).set(true); | |||
// modelNode.get(TransactionSubsystemRootResourceDefinition.MAXIMUM_TIMEOUT.getName()).set(31536000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be un-commented or removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do that now
FailedOperationTransformationConfig.REJECTED_RESOURCE)); | ||
public void testRejectTransformersEAP640() throws Exception { | ||
testRejectTransformers(ModelTestControllerVersion.EAP_6_4_0, MODEL_VERSION_EAP64, new FailedOperationTransformationConfig().addFailedAttribute( | ||
PathAddress.pathAddress(TransactionExtension.SUBSYSTEM_PATH), new FailedOperationTransformationConfig.NewAttributesConfig("maximum-timeout"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although not caused by this PR, we might as well fix the following. 7.0.0+ introduces the following attributes not found in 6.4.0 (it is in our mail thread): [maximum-timeout, use-journal-store, statistics-enabled, journal-store-enable-async-io]. I crossed out maximum-timeout as that is being handled. But the test xml should be updated to include these and transformers added where missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could do that in a follow up issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it is more a bug than anything else. File a high-priority Jira and we're good ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kabir - I filed: https://issues.jboss.org/browse/WFLY-10715
@zhfeng please can you take a look at @jamezp comments above? You can push commits to https://github.com/jbosstm/jboss-as/tree/WFLY-10009 to address them. @jamezp thanks for the review so far! |
Thanks @tomjenkinson for working on this issue. |
@tomjenkinson @zhfeng Compilation error |
Thanks all for the review, I hope the latest push resolves the outstanding issues. |
@@ -124,14 +124,10 @@ public void initialize(ExtensionContext context) { | |||
*/ | |||
@Override | |||
public void initializeParsers(ExtensionParsingContext context) { | |||
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.TRANSACTIONS_1_0.getUriString(), TransactionSubsystem10Parser::new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kabir I am not sure why we removed these but I think the removal causes the manualmode test to fail, I will add them back and see if it passes again
3445967
to
2d79d08
Compare
@jamezp thanks for the approval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomjenkinson @zhfeng I have a few final comments. Also, please squash the commits - 15 is a bit much for a simple change :)
@@ -185,6 +185,7 @@ | |||
<include>org/jboss/as/test/integration/ee/injection/resource/basic/*TestCase.java</include> | |||
<include>org/jboss/as/test/integration/ee/naming/defaultbindings/**/*TestCase.java</include> | |||
<include>org/jboss/as/test/integration/transaction/inflow/TransactionInflowTestCase.java</include> | |||
<include>org/jboss/as/test/integration/transaction/MaximumTimeoutTestCase.java</include> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomjenkinson @zhfeng this also needs adding to the s of the basic-integration-default-web.surefire execution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done (I think) it was to add to exclude I think (the word you used before "s" is not showing in github UI correctly, maybe it is parsing some XML?)
ResourceTransformationDescriptionBuilder builderEap71 = chainedBuilder.createBuilder(CURRENT_MODEL_VERSION, MODEL_VERSION_EAP71); | ||
builderEap71.getAttributeBuilder() | ||
.setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(MAXIMUM_TIMEOUT.getDefaultValue()), MAXIMUM_TIMEOUT) | ||
.addRejectCheck(new RejectAttributeChecker.SimpleAcceptAttributeChecker(MAXIMUM_TIMEOUT.getDefaultValue()), MAXIMUM_TIMEOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT this should be RejectAttributeChecker.DEFINED. The discard on the line above deals with the 'allowed' value. I've tried and the tests pass.
@kabir hopefully addresses your final comments |
…ribute and only reject the non-default value.
Just an FYI. The |
WFLY-10009 maximum timeout attribute
https://issues.jboss.org/browse/WFLY-10009
Should likely replace #10998 if it passes.
Thanks for submitting your Pull Request!
Please make sure your PR meets the following requirements:
[WFLY-XYZ] Subject
orWFLY-XYZ Subject
For bigger changes, major and minor component upgrades make sure your PR also meets following requirements:
For new features ensure as well:
If you are not an active contributor of the WildFly project you can request sponsorship by one of the members to help guide you through the process.