Initial commit: archer, a Go-native MySQL/MariaDB table archiver
Renamed from arcdb: module path, cmd/archer, internal/archererr, docs, build scripts and ARCHER_* environment variables. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
bc4a6b504f
99 files changed
+12752
No files matched your search
@@ -0,0 +1,29 @@
|
||||
//go:build windows
|
||||
|
||||
package atomicfile
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Windows 上值得重试的错误码。
|
||||
const (
|
||||
errAccessDenied syscall.Errno = 5 // ERROR_ACCESS_DENIED
|
||||
errSharingViol syscall.Errno = 32 // ERROR_SHARING_VIOLATION
|
||||
errLockViolation syscall.Errno = 33 // ERROR_LOCK_VIOLATION
|
||||
errBusy syscall.Errno = 170 // ERROR_BUSY
|
||||
errUserMapped syscall.Errno = 1224 // ERROR_USER_MAPPED_FILE
|
||||
)
|
||||
|
||||
func isTransientErrno(err error) bool {
|
||||
var errno syscall.Errno
|
||||
if !errors.As(err, &errno) {
|
||||
return false
|
||||
}
|
||||
switch errno {
|
||||
case errAccessDenied, errSharingViol, errLockViolation, errBusy, errUserMapped:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in new issue
Block a user