dque
dque copied to clipboard
Dequeue is failing while deleting the segment "The process cannot access the file because it is being used by another process"
Hi, I was trying a simple program to enqueue and dequeue 10 elements. with segment size 5 its failing with below error main.go and go.mod files attached PS C:\Sai_laptop_backup\workspace\golang\dque_test> .\main.exe Enqueued SAI100 1 Enqueued SAI101 2 Enqueued SAI102 3 Enqueued SAI103 4 Enqueued SAI104 5 Enqueued SAI105 6 Enqueued SAI106 7 Enqueued SAI107 8 Enqueued SAI108 9 Enqueued SAI109 10 Dequeued: &{SAI100 1} Dequeued: &{SAI101 2} Dequeued: &{SAI102 3} Dequeued: &{SAI103 4} 2021/07/20 11:22:49 Error dequeuing item:error deleting queue segment C:/Sai_laptop_backup/workspace/golang/dque_test/item-queue/0000000000001.dque. Queue is in an inconsistent state: error deleting file: C:/Sai_laptop_backup/workspace/golang/dque_test/item-queue/0000000000001.dque: remove C:/Sai_laptop_backup/workspace/golang/dque_test/item-queue/0000000000001.dque: The process cannot access the file because it is being used by another process.
main.go and go.mod files are attached
It is failing to remove the first segment from the queue
Hi, Thank you for reporting that. I don't have access to a Windows machine. If you figure it out and find a fix, please create a Pull Request. Or at least let me know what the fix is.