Skip to content

Connection to influx still active even after calling influxdb.close(); #459

Open
@saif-17

Description

@saif-17

Connection to influx still active even after calling influxdb.close();

Here is my Test Code

   public static void main (String[]args){
            InfluxDB influxDBConnection;

            for (int i = 0; i < 10; i++) {
                try {
                    QueryResult queryResult;
                    influxDBConnection = InfluxDBFactory.connect("url", "username", "password");
                    queryResult = influxDBConnection.query(new Query("select value1 from test_measurement1", "test_db"));
                    System.out.println(queryResult.getResults().get(0).getSeries().get(0).getValues().get(0).get(1).toString());
                    influxDBConnection.close();
                    Thread.sleep(10000);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }

After execution of following code 10 connections are made even after calling the close method.
I checked the number of connection made to influxdb through netstat.

Is there any way to close the existing influx connection?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions