-
Notifications
You must be signed in to change notification settings - Fork 179
Nc4Iosp preferred and always loaded by the dap4 controller if c library is present #1142
Comments
Hah! Caught me :-) |
There is also code that does this same thing in the dap4 module ( thredds/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDSP.java Lines 60 to 79 in 11b9d63
Maybe we should remove it to make sure no one accidentally uses it? |
Agreed, I will take care of it. (THis is version 5, right?). |
Ah, that's right - you synchronized the whole library. Yep - this is all version 5. We know for sure that the core dump happens when reading through the c library. The question in my mind is why are we reading through the c library when the default setting is "do not use the c library for reading". It seems to me that the dap4 controller only needs to be initialized for that setting to be ignored across the board (once loaded, the IOSP will be used everywhere). At the very least, we should only read through the c library if the option is explicitly set in the threddsConfig file, and that's handled by @WardF and I will look through the core file to see if we can get an idea of where things are going wrong. |
Agreed, mostly. can you tell what function in the C library is being called |
Ward and I are supposed to meet at one tomorrow. |
Ok, here is some more info. Everything goes well on a clean startup of the server. We read and write netcdf-4 data, no problem, like a champ. According to the logs, things are chugging along, good times. Then, we get this showing up in
Someone hits I can now predictably make this happen on thredds-test, and can only get a core dump once I've made a dap4 request, thus triggering the reading via the c library. So now, here is my question: is the real issue due to something going wrong when switching between the |
Ok, I can run the TDS with netCDF-C library reading enabled from the start, and I still get core dumps. Probably not the switching between the IOSPs that cause issues. |
...and it's not always on the same netCDF-4 file. |
I am amazed; someone is actually using DAP4? |
Here is an interesting case from the
In this case, we open and start reading from a GOES 16 netCDF-4 file, then open and read from a surface data netCDF-4 file. However, based on second number in square brackets (730 or 777), it would seem that we are read from the two sources concurrently? |
You have to be careful about what that means. Remember that each call to the JNA |
Ah, yes - I think that's the case here (that is, not concurrent access) |
So the core dumps we have been seeing on thredds-test happen while reading netCDF-4 files through the c library, even when
threddsConfig.xml
explicitly says not to use the netCDF-C library for reading. I've confirmed this by enabling various kinds of logging and pushing the server until it core dumps.During TDS initialization,
threddsConfig.xml
is checked to see if reading via the c library is allowed prior to loading theNc4Iosp
(default is false):thredds/tds/src/main/java/thredds/server/config/TdsInit.java
Lines 261 to 274 in e7588da
The same happens in netCDF-Java at runtime:
thredds/cdm/src/main/java/ucar/nc2/util/xml/RuntimeConfigParser.java
Lines 267 to 275 in 11b9d63
That said, it looks like there is code in the
Dap4Controller
that registers theNc4Isop
without any check at all:thredds/tds/src/main/java/thredds/server/dap4/Dap4Controller.java
Lines 76 to 93 in e7588da
This is why we end up reading through the netCDF-C library, even when we set the configuration to not do that.
I think what we are seeing on thredds-test is a crash due to multiple threads using the netCDf-C library to read different files simultaneously. Given the popularity of netCDF-4 products from GOES-16 and GOES-17, I am surprised we don't see this more often.
@DennisHeimbigner, @WardF - what do you think? Is reading files through the netCDF-C library necessary for
DAP4
? It seems like we would need to lock while reading through the C library, like we do when writing through the C library, and that seems like it would kill performance when dealing with netCDF files across the board.The text was updated successfully, but these errors were encountered: