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

tomcat has many open filehandles on known providers file #37

Open
alaniwi opened this issue Jul 17, 2020 · 1 comment
Open

tomcat has many open filehandles on known providers file #37

alaniwi opened this issue Jul 17, 2020 · 1 comment

Comments

@alaniwi
Copy link
Contributor

alaniwi commented Jul 17, 2020

lsof shows that the tomcat java process on data node is not closing filehandles on /esg/config/esgf_known_providers.xml

Example:

  • count open filehandles while avoiding double-counting with multi-threading
# lsof -P -n -p `pidof java` | cut -b 11-15,22- | sort -u | grep -c esgf_known_providers.xml
23
  • also set strace going
# strace -f -p `pidof java` -e '!futex' -o strace.out
  • In browser, load https://<data_node>/esg-orp/home.htm

  • In terminal, interrupt (ctrl-C) the strace

  • count the open filehandles again -- one more than previously:

# lsof -P -n -p `pidof java` | cut -b 11-15,22- | sort -u | grep -c esgf_known_providers.xml
24
  • see what the strace found
# grep known_providers strace.out 
2590  stat("/esg/config/esgf_known_providers.xml", {st_mode=S_IFREG|0644, st_size=2396, ...}) = 0
2590  open("/esg/config/esgf_known_providers.xml", O_RDONLY) = 109
2590  stat("/esg/config/esgf_known_providers.xml", {st_mode=S_IFREG|0644, st_size=2396, ...}) = 0
2590  stat("/esg/config/esgf_known_providers.xml", {st_mode=S_IFREG|0644, st_size=2396, ...}) = 0
2590  stat("/esg/config/esgf_known_providers.xml", {st_mode=S_IFREG|0644, st_size=2396, ...}) = 0
# grep -w 109 strace.out
[... snip ...]
2590  open("/esg/config/esgf_known_providers.xml", O_RDONLY) = 109
2590  fstat(109, {st_mode=S_IFREG|0644, st_size=2396, ...}) = 0
2590  read(109, "<?xml version=\"1.0\" encoding=\"UT"..., 8192) = 2396
2590  fstat(109, {st_mode=S_IFREG|0644, st_size=2396, ...}) = 0
2590  lseek(109, 0, SEEK_CUR)           = 2396
2590  fstat(109, {st_mode=S_IFREG|0644, st_size=2396, ...}) = 0
2590  lseek(109, 0, SEEK_CUR)           = 2396
2590  read(109, "", 8192)               = 0

with no close

@alaniwi
Copy link
Contributor Author

alaniwi commented Jul 17, 2020

Here is where the file is used:

<fmt:setBundle var="bundle" basename="esg-orp"/>
<fmt:message var="path" key="orp.provider.list" bundle="${bundle}"/>
<c:import url="file:${path}" var="doc_xml"/>
<x:parse xml="${doc_xml}" var="parsed_doc"/>
<select name="openid_identifier" id="openid_identifier">
<x:forEach select="$parsed_doc/OPS/OP" var="item">
<option value=<x:out select="$item/URL"/>><x:out select="$item/NAME"/></option>
</x:forEach>
</select>

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

No branches or pull requests

1 participant