influxdata / influxdata/influxdb-java

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

Open
#459 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Java
Stars
1.2k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided loop and checking the connection behavior with netstat. Read the InfluxDBFactory.connect and InfluxDB.close lifecycle documented or exposed by the client; done means repeated connect/close calls do not leave the observed connections active.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.