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

Adding connection close to http4 endpoints #58

Merged
merged 2 commits into from
Mar 7, 2019

Conversation

dannylamb
Copy link
Contributor

GitHub Issue: Islandora/documentation#978

What does this Pull Request do?

Adds connectionClose=true to all the http endpoints in our camel routes. This forces Camel to add a Connection: close header to all requests, terminating the connection immediately after receiving the response.

What's new?

connectionClose=true all over the place as an endpoint parameter.

How should this be tested?

  • /opt/karaf/bin/client
  • la | grep islandora
  • Get the bundle ids for islandora-indexing-triplestore, islandora-indexing-fcrepo, and islandora-connector-derivative
  • bundle:stop your_id for each of those ids
  • Hit Ctrl+D to get out of the console
  • cd ~
  • git clone -b connection-close https://github.com/dannylamb/Alpaca.git
  • cd Alpaca
  • ./gradlew install
  • Then copy the jars for the three bundles we stopped into /opt/karaf/deploy
    • sudo cp islandora-indexing-fcrepo/build/libs/islandora-indexing-fcrepo-0.7.1.jar /opt/karaf/deploy
    • sudo cp islandora-indexing-triplestore/build/libs/islandora-indexing-triplestore-0.7.1.jar /opt/karaf/deploy
    • sudo cp islandora-connector-derivative/build/libs/islandora-connector-derivative-0.7.1.jar /opt/karaf/deploy

Then run your test migration that does a bunch of stuff and monitor the files karaf keeps open with lsof.

sudo lsof | grep karaf | wc -l

You should see it go up slightly during the migration, but maintain (and even somes drop a little) if you keep running lsof over and over. When it's done, files should go back down to idle levels.

I tested this by using devel_generate to make 1000 taxonomy terms, but @seth-shaw-unlv's tiff migration seems like a good test 🚀

Additional Notes:

This is it.

Interested parties

@Islandora-CLAW/committers

@dannylamb
Copy link
Contributor Author

@seth-shaw-unlv Try out this PR and if it works for you, i'll update the tests. I just need to account for the extra connectionClose=true in the mocks, but I wanna confirm this does the job first.

@seth-shaw-unlv
Copy link
Contributor

@dannylamb, this looks like it is working great.

@codecov
Copy link

codecov bot commented Mar 7, 2019

Codecov Report

Merging #58 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #58   +/-   ##
=========================================
  Coverage     84.71%   84.71%           
  Complexity       93       93           
=========================================
  Files            16       16           
  Lines           314      314           
  Branches          1        1           
=========================================
  Hits            266      266           
  Misses           47       47           
  Partials          1        1
Impacted Files Coverage Δ Complexity Δ
...paca/connector/derivative/DerivativeConnector.java 100% <100%> (ø) 3 <0> (ø) ⬇️
...slandora/alpaca/indexing/fcrepo/FcrepoIndexer.java 90.24% <100%> (ø) 6 <0> (ø) ⬇️
...lpaca/indexing/triplestore/TriplestoreIndexer.java 100% <100%> (ø) 6 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df29780...27f53d4. Read the comment docs.

@dannylamb
Copy link
Contributor Author

@seth-shaw-unlv Ok, patched up those tests. This is ready to go.

Copy link
Contributor

@seth-shaw-unlv seth-shaw-unlv left a comment

Choose a reason for hiding this comment

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

:shipit:

@seth-shaw-unlv seth-shaw-unlv merged commit 67eac07 into master Mar 7, 2019
@seth-shaw-unlv seth-shaw-unlv deleted the connection-close branch March 7, 2019 15:41
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