You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
readSpecificJsonMessage is called and wants to read message nr 1 from a queue with 2 messages
checkForExpiry is running at the same time and removes message nr 0 from the same queue, making message nr 1 now message nr 0.
When the message needs to be retrieved for readSpecificJsonMessage, message nr 1 no longer exists and causes a panic since the read tries to read beyond the end of the queue
Probable solution:
Use queue locking for read actions as well as write actions.
The text was updated successfully, but these errors were encountered:
In some cases readSpecificJsonMessage panics with the following error:
Delta Agent 0.1.-beta1
panic: runtime error: index out of range [1] with length 1
goroutine 23 [running]:
github.com/quadtrix/basicqueue.(*BasicQueue).readSpecificJsonMessage(0xc0001185a0, 0x1)
/home/nhtbrink/go/pkg/mod/github.com/quadtrix/basicqueue@v0.0.0-20230808074438-d245b21dd56b/basicqueue.go:548 +0x79f
github.com/quadtrix/basicqueue.(*BasicQueue).ReadJsonWithHistory(0xc0001185a0, {0xc0000b2000, 0x35}, {0xc00013afa0, 0x63, 0xaa?})
/home/nhtbrink/go/pkg/mod/github.com/quadtrix/basicqueue@v0.0.0-20230808074438-d245b21dd56b/basicqueue.go:633 +0x4bc
github.com/quadtrix/client_connector.(*ClientConnection).heartbeatSender(0xc0000ae000, 0x0?, 0x0?)
/home/nhtbrink/go/pkg/mod/github.com/quadtrix/client_connector@v0.0.0-20221009195911-96e8762ce08f/client_connector.go:531 +0x468
created by github.com/quadtrix/client_connector.New
/home/nhtbrink/go/pkg/mod/github.com/quadtrix/client_connector@v0.0.0-20221009195911-96e8762ce08f/client_connector.go:164 +0xafc
This is probably the scenario:
Probable solution:
Use queue locking for read actions as well as write actions.
The text was updated successfully, but these errors were encountered: