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

WFLY-10009 Introduce a maximum-timeout management model attribute #11440

Merged
merged 5 commits into from Jul 30, 2018

Conversation

tomjenkinson
Copy link
Contributor

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:

  • Pull Request title is properly formatted: [WFLY-XYZ] Subject or WFLY-XYZ Subject
  • Pull Request contains link to the JIRA issue(s)
  • Pull Request contains description of the issue(s)
  • Pull Request does not include fixes for issues other than the main ticket
  • Attached commits represent units of work and are properly formatted

For bigger changes, major and minor component upgrades make sure your PR also meets following requirements:

  • Pull Request requires a change to the documentation
  • Documentation have been updated accordingly
  • Tests were added to cover changes

For new features ensure as well:

  • Analysis was done
  • Test Plan has been done
  • Tests were verified in advance

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.

@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";
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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")
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Member

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.
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

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);
Copy link
Member

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.

Copy link
Contributor Author

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

@jamezp jamezp added the Feature PR provides a new feature label Jul 18, 2018
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")));
Copy link
Contributor

@kabir kabir Jul 19, 2018

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

Copy link
Contributor Author

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?

Copy link
Contributor

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 ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomjenkinson
Copy link
Contributor Author

@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!

@zhfeng
Copy link
Contributor

zhfeng commented Jul 23, 2018

Thanks @tomjenkinson for working on this issue.

@kabir
Copy link
Contributor

kabir commented Jul 23, 2018

@tomjenkinson @zhfeng Compilation error

@tomjenkinson
Copy link
Contributor Author

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);
Copy link
Contributor Author

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

@tomjenkinson tomjenkinson force-pushed the WFLY-10009 branch 2 times, most recently from 3445967 to 2d79d08 Compare July 25, 2018 16:28
@tomjenkinson
Copy link
Contributor Author

I am seeing that HotRod failing test is not new, as such could this be merged yet please?

/cc @kabir @jamezp

@jamezp jamezp added ready-for-merge Only for use by those with merge permissions! and removed Feature PR provides a new feature labels Jul 26, 2018
@tomjenkinson
Copy link
Contributor Author

@jamezp thanks for the approval

@jamezp jamezp added ready-for-merge Only for use by those with merge permissions! and removed ready-for-merge Only for use by those with merge permissions! labels Jul 26, 2018
@wildfly wildfly deleted a comment from jamezp Jul 30, 2018
@wildfly wildfly deleted a comment from tomjenkinson Jul 30, 2018
@wildfly wildfly deleted a comment from tomjenkinson Jul 30, 2018
Copy link
Contributor

@kabir kabir left a 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>
Copy link
Contributor

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

Copy link
Contributor Author

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)
Copy link
Contributor

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 kabir added fixme and removed ready-for-merge Only for use by those with merge permissions! labels Jul 30, 2018
@tomjenkinson
Copy link
Contributor Author

@kabir hopefully addresses your final comments

@jamezp
Copy link
Member

jamezp commented Jul 30, 2018

Just an FYI. The TransactionSubsystemTestCase was failing due to adding the maximum-timeout attribute to the 1.5.0 (EAP 6.4) model. I removed that and the commented out changes for the ModelFixer's. I rebased and forced push to the jbosstm/WFLY-10009 branch. Once CI passes we'll try to get this merged.

@jamezp jamezp added ready-for-merge Only for use by those with merge permissions! and removed fixme labels Jul 30, 2018
jamezp added a commit that referenced this pull request Jul 30, 2018
WFLY-10009 maximum timeout attribute
@jamezp jamezp merged commit 3e0ee5b into wildfly:master Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Only for use by those with merge permissions!
Projects
None yet
5 participants