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

Stop using onSpinWait #203

Merged
merged 2 commits into from
May 23, 2024
Merged

Stop using onSpinWait #203

merged 2 commits into from
May 23, 2024

Conversation

whikloj
Copy link
Contributor

@whikloj whikloj commented May 6, 2024

JIRA Ticket: https://fedora-repository.atlassian.net/browse/FCREPO-3940

What does this Pull Request do?

Alters Thread.onSpinWait to use latch and await to avoid using CPU cycles to wait.
Also adds additional debug/trace logging to Solr route
Adds the default transform as the default on the property for Solr indexing
Adds some additional documentation on Solr indexing.

How should this be tested?

Run the camel-toolbox before this PR and see 95-100% CPU usage by java when no messages are being processed, after this is much lower. (Credit to @pwinckles for the work)

You can also increase the log level to trace to see additional messages.

Lastly before this PR if you do not define the solr.fcrepo.defaultTransform property there is no default transform. After you will get the internal one.

Additional Notes:

Any additional information that you think would be helpful when reviewing this PR.

Example:

  • Does this change require documentation to be updated?
  • Does this change add any new dependencies?
  • Does this change require any other modifications to be made to the repository (ie. Regeneration activity, etc.)?
  • Could this change impact execution of existing code?

Interested parties

Tag (@ mention) interested parties or, if unsure, @fcrepo/committers

whikloj added 2 commits April 26, 2024 12:16
Add default transform as default

Reduce complex choice
@whikloj
Copy link
Contributor Author

whikloj commented May 6, 2024

Resolves #194

@mikejritter mikejritter self-requested a review May 23, 2024 15:47
Copy link
Contributor

@mikejritter mikejritter left a comment

Choose a reason for hiding this comment

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

Works as expected, I see a drop in cpu usage when running compared to main 👍

The solr changes look ok as well, and all tests passed when building.

One thing that I noticed is that I'm always getting a non-zero exit code, but I think that can be a separate ticket as that happens on main as well. It's not really a big deal but would be nice for e.g. sigterm being sent.

@mikejritter mikejritter merged commit 40041f9 into fcrepo-exts:main May 23, 2024
3 checks passed
whikloj added a commit that referenced this pull request Sep 12, 2024
* Initial commit of solr basic auth functionality

* reducing log level of solr indexer when using auth

* FCREPO-3834 Enable Camel toolbox to send xml records to Solr indexing service (#191)

* replacing ldpath service with XSLT processing solr indexer

* no longer need HTTP_URI

* added properties for new solr xsl transforms to docker-compose properties file

* returning config to original state rather than my dev stack

* adding fields to solr xsl

---------

Co-authored-by: Dan Field <[email protected]>

* [maven-release-plugin] prepare release fcrepo-camel-toolbox-6.1.0

* [maven-release-plugin] prepare for next development iteration

* Stop using onSpinWait (#203)

Alters Thread.onSpinWait to use latch and await to avoid using CPU cycles to wait.
Also adds additional debug/trace logging to Solr route
Adds the default transform as the default on the property for Solr indexing
Adds some additional documentation on Solr indexing.

* Alterations at Jared's request on PR

* Initial commit of solr basic auth functionality

* reducing log level of solr indexer when using auth

* Alterations at Jared's request on PR

---------

Co-authored-by: Jared Whiklo <[email protected]>
@whikloj whikloj deleted the FCREPO-3940 branch October 24, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants