GithubHelp home page GithubHelp logo

Comments (9)

citrusreticulata avatar citrusreticulata commented on May 27, 2024

请问可以提供更多信息吗?例如:

  1. 服务端版本
  2. go客户端版本(commit id)
  3. 能稳定复现问题的go客户端代码片段
  4. 服务端配置
  5. 其他可能有帮助的信息

from iotdb-client-go.

iotopo avatar iotopo commented on May 27, 2024

@citrusreticulata 你好

  1. 服务端版本
    1.0.0
  2. go客户端版本(commit id)
    1.0.0
  3. 能稳定复现问题的go客户端代码片段
  4. 服务端配置
    默认
  5. 其他可能有帮助的信息
    服务器端运行环境为 windows

from iotdb-client-go.

HTHou avatar HTHou commented on May 27, 2024

可以提供一下iotdb端的日志吗

from iotdb-client-go.

iotopo avatar iotopo commented on May 27, 2024

我写了一个最小复现的代码,现在来看应该是 session 不支持并发。

func main() {
	session := client.NewSession(&client.Config{
		Host:     "127.0.0.1",
		Port:     "6667",
		UserName: "root",
		Password: "root",
	})

	if err := session.Open(false, 0); err != nil {
		panic(err)
	}

	timeout := int64(20000)
	go func() {
		_, err := session.ExecuteQueryStatement("select last v1 as value from root.ln.wf02.wt02", &timeout)
		if err != nil {
			panic(err)
		}
	}()

	go func() {
		_, err := session.ExecuteQueryStatement("select last hardware as value from root.ln.wf02.wt02", &timeout)
		if err != nil {
			panic(err)
		}
	}()
	time.Sleep(time.Second * 200)
}

from iotdb-client-go.

iotopo avatar iotopo commented on May 27, 2024

@HTHou iotdb server 端报错如下:
image

from iotdb-client-go.

HTHou avatar HTHou commented on May 27, 2024

我写了一个最小复现的代码,现在来看应该是 session 不支持并发。

func main() {
	session := client.NewSession(&client.Config{
		Host:     "127.0.0.1",
		Port:     "6667",
		UserName: "root",
		Password: "root",
	})

	if err := session.Open(false, 0); err != nil {
		panic(err)
	}

	timeout := int64(20000)
	go func() {
		_, err := session.ExecuteQueryStatement("select last v1 as value from root.ln.wf02.wt02", &timeout)
		if err != nil {
			panic(err)
		}
	}()

	go func() {
		_, err := session.ExecuteQueryStatement("select last hardware as value from root.ln.wf02.wt02", &timeout)
		if err != nil {
			panic(err)
		}
	}()
	time.Sleep(time.Second * 200)
}

是的 单个session不能并发使用,如果有并发,需要使用多个session。

from iotdb-client-go.

iotopo avatar iotopo commented on May 27, 2024

驱动包里没有考虑提供一个可以使用的 session pool 吗?需要业务侧自己实现一个是吧?

from iotdb-client-go.

HTHou avatar HTHou commented on May 27, 2024

#75 有开源贡献者正在贡献session pool 的相关代码,可以等待一下新版本发布。

from iotdb-client-go.

iotopo avatar iotopo commented on May 27, 2024

#75 有开源贡献者正在贡献session pool 的相关代码,可以等待一下新版本发布。

好的,感谢回复

from iotdb-client-go.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.