Closed mgdigital closed 2 months ago
Could you see if this branch works better for you @vadimkim?
Can't build. Error:
C:\Users\vadim\Projects\bitmagnet>go build
go: downloading github.com/go-resty/resty/v2 v2.11.0
# github.com/bitmagnet-io/bitmagnet/internal/protocol/dht/server
internal\protocol\dht\server\socket_windows.go:57:12: undefined: syscall
Can't build. Error:
C:\Users\vadim\Projects\bitmagnet>go build go: downloading github.com/go-resty/resty/v2 v2.11.0 # github.com/bitmagnet-io/bitmagnet/internal/protocol/dht/server internal\protocol\dht\server\socket_windows.go:57:12: undefined: syscall
Sorry could you try it again that error should be fixed? I literally can't validate this myself!
@mgdigital
The go
tools will read the GOOS
environment variable which can help when testing code for other platforms.
E.g. $GOOS=windows go vet ./...
on a Linux system, should catch that issue.
go vet
usually works to make sure a package has no syntax issues. And as long as you don't have too many platform specific dependencies go build
can often produces a working binary for that GOOS
target.
I imported "syscall" and compiled, no problem with that. You just need to add this import to source code. Testing right now. Let me have couple of days to look closely on behaviour.
Preliminary results:
{"severity":"ERROR","timestamp":"2024-03-09T10:13:16.9659892+02:00","logger":"queue","caller":"server/server.go:85","message":"Error waiting for notification: conn closed","stacktrace":"github.com/bitmagnet-io/bitmagnet/internal/queue/server.(*server).Start.func3\n\tC:/Users/vadim/Projects/bitmagnet/internal/queue/server/server.go:85"}
{"severity":"ERROR","timestamp":"2024-03-09T10:13:16.9659892+02:00","logger":"queue","caller":"server/server.go:85","message":"Error waiting for notification: conn closed","stacktrace":"github.com/bitmagnet-io/bitmagnet/internal/queue/server.(*server).Start.func3\n\tC:/Users/vadim/Projects/bitmagnet/internal/queue/server/server.go:85"}
{"severity":"ERROR","timestamp":"2024-03-09T10:13:16.9659892+02:00","logger":"queue","caller":"server/server.go:85","message":"Error waiting for notification: conn closed","stacktrace":"github.com/bitmagnet-io/bitmagnet/internal/queue/server.(*server).Start.func3\n\tC:/Users/vadim/Projects/bitmagnet/internal/queue/server/server.go:85"}
{"severity":"ERROR","timestamp":"2024-03-09T10:13:16.9659892+02:00","logger":"queue","caller":"server/server.go:85","message":"Error waiting for notification: conn closed","stacktrace":"github.com/bitmagnet-io/bitmagnet/internal/queue/server.(*server).Start.func3\n\tC:/Users/vadim/Projects/bitmagnet/internal/queue/server/server.go:85"}
{"severity":"ERROR","timestamp":"2024-03-09T10:13:16.9659892+02:00","logger":"queue","caller":"server/server.go:85","message":"Error waiting for notification: conn closed","stacktrace":"github.com/bitmagnet-io/bitmagnet/internal/queue/server.(*server).Start.func3\n\tC:/Users/vadim/Projects/bitmagnet/internal/queue/server/server.go:85"}
{"severity":"ERROR","timestamp":"2024-03-09T10:13:16.9659892+02:00","logger":"queue","caller":"server/server.go:85","message":"Error waiting for notification: conn closed","stacktrace":"github.com/bitmagnet-io/bitmagnet/internal/queue/server.(*server).Start.func3\n\tC:/Users/vadim/Projects/bitmagnet/internal/queue/server/server.go:85"}
{"severity":"ERROR","timestamp":"2024-03-09T10:13:16.9659892+02:00","logger":"queue","caller":"server/server.go:85","message":"Error waiting for notification: conn closed","stacktrace":"github.com/bitmagnet-io/bitmagnet/internal/queue/server.(*server).Start.func3\n\tC:/Users/vadim/Projects/bitmagnet/internal/queue/server/server.go:85"}
Thanks. It looks encouraging. That error you posted looks like the queue has lost its connection to the database for a while. If you can still see new torrents appearing that means the queue is working....
I expect the error code fix here is only going to help Windows users running from a .exe file. Docker for Windows users have also been reporting issues but their OS will be reported as Unix, and as with the Anacrolix fix here this bit won't be triggered for them: https://github.com/anacrolix/dht/blob/master/errnos_windows.go. Do you have any insight on this @djdv ? And @vadimkim I expect if you build this branch as a Docker image you'll still be seeing issues with that, do you still see the same Socket read error
?
I finished testing this code and have experienced the reported error in preliminary results twice. From the command line everything works and I was able to download around 300k DHTs during weekend. @mgdigital do you want me to build docker image with bitmagnet.exe inside? Can you suggest me what Docker image to take as base image?
Thanks @vadimkim , lets get this PR merged and come back to the Docker stuff - it will just be using the ghcr image, I expect there might still be Windows issues.
Referencing this from the previous pull: https://github.com/bitmagnet-io/bitmagnet/pull/144#issuecomment-1985699351