Skip to content

Bug: Concurrent queries over the same connection #1591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Aditya-ds-1806 opened this issue Mar 18, 2025 · 1 comment
Open

Bug: Concurrent queries over the same connection #1591

Aditya-ds-1806 opened this issue Mar 18, 2025 · 1 comment
Milestone

Comments

@Aditya-ds-1806
Copy link

Steps to reproduce:

I Modified the example program to execute 2 queries simultaneously with the same client:

package main

import (
	"fmt"
	"sync"

	"github.com/dicedb/dicedb-go"
	"github.com/dicedb/dicedb-go/wire"
)

func main() {
	client, err := dicedb.NewClient("localhost", 7379)
	if err != nil {
		fmt.Println(err)
	}

	var wg sync.WaitGroup

	wg.Add(2)

	go func() {
		defer wg.Done()
		resp := client.Fire(&wire.Command{Cmd: "PING"})
		fmt.Println(resp)
	}()

	go func() {
		defer wg.Done()
		resp := client.Fire(&wire.Command{Cmd: "HANDSHAKE", Args: []string{"hsajdbsdbs", "command"}})
		fmt.Println(resp)
	}()

	wg.Wait()
}

If we try running this, after several tries we will notice one of the commands fail (PING in this case). Also, when there was no failure, response was sent for one command and after that the server just hanged, there was no response.
Image

@Aditya-ds-1806 Aditya-ds-1806 changed the title Bug: Concurrent reads over the same connection Bug: Concurrent queries over the same connection Mar 18, 2025
@arpitbbhayani
Copy link
Contributor

Thanks for raising this. Picking this up on priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants