Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-1221

BigdataSailRemoteRepository uses non-daemon thread pool

    Details

    • Type: Bug
    • Status: Done
    • Priority: Highest
    • Resolution: Fixed
    • Affects Version/s: BLAZEGRAPH_RELEASE_1_5_1
    • Fix Version/s: BLAZEGRAPH_RELEASE_1_5_2
    • Component/s: B+Tree
    • Labels:
      None

      Description

      Potential reason:?BigdataSailRemoteRepository creates ExecutionService with default
      thread factory, which creates thread, not marked as daemon. For some reason
      graph.shutdown() does not result in termination of executor threads.

      public static void main(String[] args) throws IOException, RepositoryException {
      final BigdataGraph graph = new BigdataGraphClient("http://localhost:9999/bigdata")?
      final String testFile = "/graph?example?1.xml"?
      GraphMLReader.inputGraph(graph,
      RemoteBlueprint.class.getResourceAsStream(testFile))?
      for (Vertex v : graph.getVertices()) {
      System.err.println(v)?
      }
      for (Edge e : graph.getEdges()) {
      System.err.println(e)?
      }
      graph.shutdown()?
      }
      

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        Fixed in 2a5d6aabd2ace8f32e6b07b323b6bef90d27f812 (TICKET_1156b, github).

        Show
        bryanthompson bryanthompson added a comment - Fixed in 2a5d6aabd2ace8f32e6b07b323b6bef90d27f812 (TICKET_1156b, github).
        Hide
        bradbebee bradbebee added a comment -

        This make also resolve BLZG-1215: Gremlin Shell hangs on exit.

        Show
        bradbebee bradbebee added a comment - This make also resolve BLZG-1215 : Gremlin Shell hangs on exit.
        Hide
        amrutha Amrutha Valli added a comment -

        It is still occuring below is the code i am using

        package sample.blueprints.remote;

        import java.io.InputStream;
        import java.nio.file.Files;
        import java.nio.file.Path;
        import java.nio.file.StandardCopyOption;

        import org.apache.log4j.Logger;

        import com.bigdata.blueprints.BigdataGraph;
        import com.bigdata.blueprints.BigdataGraphClient;
        import com.tinkerpop.blueprints.Edge;
        import com.tinkerpop.blueprints.Vertex;

        public class SampleBlazegraphBlueprintsRemote {
        protected static final Logger log = Logger.getLogger(SampleBlazegraphBlueprintsRemote.class);

        public static void main(String[] args) throws Exception {

        final BigdataGraph graph = new BigdataGraphClient("http://localhost:8080/bigdata/sparql");
        try {
        graph.loadGraphML(SampleBlazegraphBlueprintsRemote.class.getResource("/graph-example-1.xml").getFile());
        for (Vertex v : graph.getVertices())

        { log.info(v); }

        for (Edge e : graph.getEdges())

        { log.info(e); }

        } finally

        { graph.shutdown(); }

        }
        }

        Show
        amrutha Amrutha Valli added a comment - It is still occuring below is the code i am using package sample.blueprints.remote; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import org.apache.log4j.Logger; import com.bigdata.blueprints.BigdataGraph; import com.bigdata.blueprints.BigdataGraphClient; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Vertex; public class SampleBlazegraphBlueprintsRemote { protected static final Logger log = Logger.getLogger(SampleBlazegraphBlueprintsRemote.class); public static void main(String[] args) throws Exception { final BigdataGraph graph = new BigdataGraphClient("http://localhost:8080/bigdata/sparql"); try { graph.loadGraphML(SampleBlazegraphBlueprintsRemote.class.getResource("/graph-example-1.xml").getFile()); for (Vertex v : graph.getVertices()) { log.info(v); } for (Edge e : graph.getEdges()) { log.info(e); } } finally { graph.shutdown(); } } }
        Hide
        bryanthompson bryanthompson added a comment -

        What blazegraph version are you using?

        Show
        bryanthompson bryanthompson added a comment - What blazegraph version are you using?
        Hide
        beebs Brad Bebee added a comment -

        thompsonbry I replicated against 2.2.0.

        Show
        beebs Brad Bebee added a comment - thompsonbry I replicated against 2.2.0.
        Hide
        amrutha Amrutha Valli added a comment -

        I tried with both 2.1.0 and 2.20

        Show
        amrutha Amrutha Valli added a comment - I tried with both 2.1.0 and 2.20
        Hide
        audi.lucas@wipro.com Audi Lucas added a comment - - edited

        Brad
        So then this bug exists in the current 2.2.0 version? is there a hotfix?

        Show
        audi.lucas@wipro.com Audi Lucas added a comment - - edited Brad So then this bug exists in the current 2.2.0 version? is there a hotfix?
        Hide
        beebs Brad Bebee added a comment -

        This appears to be related to BLZG-1563 and the 2.1.1 fix does not appear to apply to the BigdataGraphClient. Also, related to https://jira.blazegraph.com/browse/BLZG-1827.

        The workaround is below. BLZG-1977 has been created to fix it in the core BigdataGraphClient class.

        public class SampleBlazegraphBlueprintsRemote {
        	
        	public static final Logger log = Logger.getLogger(SampleBlazegraphBlueprintsRemote.class);
        
            public static final String serviceURL = "http://localhost:9999/blazegraph";
            public static final String namespace = "kb";
        
        	public static void main(String[] args) throws Exception {
                        
        		//BLZG-1563:   Explicitly create BigdataGraphClient with RemoteRepository
        		RemoteRepositoryManager r_mgr = new RemoteRepositoryManager(serviceURL);
        		RemoteRepository repo = (RemoteRepository) r_mgr.getRepositoryForNamespace(namespace);
        		
        		final BigdataGraph graph = new BigdataGraphClient(repo);
        		
        		try{
        		
        			final InputStream is = SampleBlazegraphBlueprintsRemote.class.getClassLoader().getResourceAsStream("graph-example-1.xml");
        			final Path file = Files.createTempFile("graph-example-1.xml", "tmp");
        			try{
        				Files.copy(is, file, StandardCopyOption.REPLACE_EXISTING);
        				graph.loadGraphML(file.toString());
        			} finally {					
        				Files.delete(file);	
        				is.close();
        			}
        			
        			for (final Vertex v : graph.getVertices()) {
        				log.info(v);
        			}
        
        			for (final Edge e : graph.getEdges()) {
        				log.info(e);
        			}
        
        		} finally {
        			graph.shutdown();
        			r_mgr.close();  //BLZG-1563
        		}
        		return;
        	}
        	
        }
        
        Show
        beebs Brad Bebee added a comment - This appears to be related to BLZG-1563 and the 2.1.1 fix does not appear to apply to the BigdataGraphClient. Also, related to https://jira.blazegraph.com/browse/BLZG-1827 . The workaround is below. BLZG-1977 has been created to fix it in the core BigdataGraphClient class. public class SampleBlazegraphBlueprintsRemote { public static final Logger log = Logger.getLogger(SampleBlazegraphBlueprintsRemote.class); public static final String serviceURL = "http: //localhost:9999/blazegraph" ; public static final String namespace = "kb" ; public static void main( String [] args) throws Exception { //BLZG-1563: Explicitly create BigdataGraphClient with RemoteRepository RemoteRepositoryManager r_mgr = new RemoteRepositoryManager(serviceURL); RemoteRepository repo = (RemoteRepository) r_mgr.getRepositoryForNamespace(namespace); final BigdataGraph graph = new BigdataGraphClient(repo); try { final InputStream is = SampleBlazegraphBlueprintsRemote.class.getClassLoader().getResourceAsStream( "graph-example-1.xml" ); final Path file = Files.createTempFile( "graph-example-1.xml" , "tmp" ); try { Files.copy(is, file, StandardCopyOption.REPLACE_EXISTING); graph.loadGraphML(file.toString()); } finally { Files.delete(file); is.close(); } for ( final Vertex v : graph.getVertices()) { log.info(v); } for ( final Edge e : graph.getEdges()) { log.info(e); } } finally { graph.shutdown(); r_mgr.close(); //BLZG-1563 } return ; } }

          People

          • Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: