Menu

#2651 IOException when tracing the cimxml

Function
closed-fixed
jsr48-client
3
2013-09-19
2013-07-18
Samuel
No

A IOException is got when tracing the cimxml:

java.io.IOException: Stream Closed
at java.io.FileOutputStream.write(FileOutputStream.java:316)
at org.sblim.cimclient.internal.wbem.WBEMClientCIMXML.transmitRequestWorker(WBEMClientCIMXML.java:1909)
at org.sblim.cimclient.internal.wbem.WBEMClientCIMXML.transmitRequest(WBEMClientCIMXML.java:1814)
at org.sblim.cimclient.internal.wbem.WBEMClientCIMXML.getClass(WBEMClientCIMXML.java:1262)

The cause is that:the cimxml trace stream is closed by one client, but other clients still use this steam to trace.

5 Attachments

Discussion

  • Dave Blaschke

    Dave Blaschke - 2013-07-18

    Currently, WBEMClient.close() closes the iCimXmlTraceFile IF AND ONLY IF it opens the stream. This leaves LogAndTraceBroker.getXmlTraceStream() returning a non-null value to other clients because LogAndTraceBroker is a static instance, and exceptions then occur when other clients attempt to trace XML.

    The close() method should at the very least LogAndTraceBroker.setXmlTraceStream(null) before closing iCimXmlTraceFile to avoid the exceptions.

    I will endeavor to look for a better solution.

     
  • Rick Blasiak

    Rick Blasiak - 2013-07-18

    I am out of the office until 07/22/2013.

    For CME-CIM technical issues contact Prashant Bhosale or Tom Phelan

    Or contact my manager: Carmen Blackley

    I will not have access to Notes during my absence

    Note: This is an automated response to your message "[sblim:bugs] #2651
    IOException when tracing the cimxml" sent on 07/18/2013 12:17:46.

    This is the only notification you will receive while this person is away.

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-18

    I have a few ideas that DON'T involve making LogAndTraceBroker non-static, but need to discuss how you are using XML tracing. Please contact me via Sametime.

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-19

    Proposed patch keeps track of a trace file, if opened, and closes it when the last WBEMClient instance is closed

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-23

    The underlying problem is that LogAndTraceBroker is static, so there is only one CIM-XML trace file allowed per JRE. So, no matter how many WBEMClients are tracing, when the first one exits, it will close the file which leads to an IOException the next time another WBEMClient attempts to log its trace.

    The best solution would be to have each WBEMClient have its own LogAndTraceBroker, but that would be a very sizable change AND could lead to other issues ("Some platforms, in particular, allow a file to be opened for writing by only one FileOutputStream (or other file-writing object) at a time"). This solution just changes the WBEMClient.iCimXmlTraceFile field to static and closes it when the last WBEMClient instance is closed.

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-23
    • status: open --> open-fixed
     
  • Dave Blaschke

    Dave Blaschke - 2013-07-23

    Patch sent for community review. During a 2 week period any exploiter may comment on the patch, request changes or turn it down completely (with good reason). For the time being the patch is part of the "Experimental" branch in CVS.

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-25

    From Samuel:

    I check the code again, i found that the synchronized is using the object as a lock

    so this works well for multi-thread per WBEMClient object case

    but i'm not sure whether it works for multi-thread of multi WBEMClient object case

    moving the OutputStream to LogAndTraceBroker should work

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-25
    • status: open-fixed --> open
     
  • Dave Blaschke

    Dave Blaschke - 2013-07-25

    Patch backed out, community review over

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-25

    Second proposed patch moves logic into LogAndTraceBroker initialization

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-26

    Third proposed patch doesn't do anything in LogAndTraceBroker unless sblim.wbem.cimxmlTracing=true

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-26

    Fourth proposed patch is same as third except initXmlTraceFile logic is enclosed within try block to catch any exceptions during initialization, such as this

     
  • Dave Blaschke

    Dave Blaschke - 2013-07-31
    • status: open --> open-fixed
     
  • Dave Blaschke

    Dave Blaschke - 2013-07-31

    Patch sent for community review. During a 2 week period any exploiter may comment on the patch, request changes or turn it down completely (with good reason). For the time being the patch is part of the "Experimental" branch in CVS.

     
  • Dave Blaschke

    Dave Blaschke - 2013-08-20
    • status: open-fixed --> pending-fixed
     
  • Dave Blaschke

    Dave Blaschke - 2013-08-20

    The community review is completed and we received no substantial criticism. Therefore the patch has been approved and merged into the "HEAD" branch. The next release will pick it up.

     
  • Akbar Ali

    Akbar Ali - 2013-08-20

    I will be out of the office starting 08/20/2013 and will not return until
    08/26/2013.

    Please contact below in my absence.
    CIMP - Dinesh R Putchala
    Any MCP defects for SFCB - Vipin Nair
    Any CPS defects for CIMP - Dinesh R Putchala / Basabjit Sengupta
    For any other urgent issues, contact my manager Ravindra S Rao

     
  • Dave Blaschke

    Dave Blaschke - 2013-09-13
    • status: pending-fixed --> closed-fixed
     
  • Dave Blaschke

    Dave Blaschke - 2013-09-13

    The patch was picked up by release 2.2.4 and will be closed.

     
  • Dave Blaschke

    Dave Blaschke - 2013-09-19
    • labels: --> Java Client (JSR48)
     

Log in to post a comment.