Comments (6)
As far as I know it has default infinity timeout and is waiting for resuming connection too long.
Correct, if you don't specify any timeout in your Go HTTP handler a value of 0 is used for read timeouts, indicating that no upper limit is set at all.
However, you can define one by creating your own HTTP server:
server := &http.Server{
ReadTimeout: 60 * time.Second,
…
}
server.ListenAndServe(…)
The tusd command we provide doesn't do this but I will add an option for it and document this in the README.
from tusd.
ReadTimeout is define timeout for whole connection (probably - i don't know go). So if everything works but takes more than 1 minute, server will terminate connection. Can you set timeout for idle?
from tusd.
http.Server.ReadTimeout is a wrapper around the net.Conn.SetReadDeadline method (https://golang.org/pkg/net/#Conn). More information can be found there.
So if everything works but takes more than 1 minute, server will terminate connection.
Yes, the connection will be closed if the read operation times out.
Can you set timeout for idle?
You can set a read and a write timeout. Is this not enough?
Anyway, I will do some testing on my site and then report back.
from tusd.
You can set a read and a write timeout. Is this not enough?
I don't know how long upload takes, sometimes 1 minutes is enough but other time I need much more.
from tusd.
Sorry, this fix is insufficient and does not fix your issue. I am working on it ATM.
from tusd.
I was able to test your second szenario (Closing internet connection by turning off WiFi) and can confirm that the server does wait for data from the connection and therefore does not update the offset.
acd3a63 added a simple read timeout but not an idle read timeout. Latter is the correct version you asked for. This has been changed in 52eb00b and should be fine now.
@LukaszMarchewka: I don't know how long upload takes, sometimes 1 minutes is enough but other time I need much more.
I now added idle timeouts, so the total duration of an upload should not be relevant any more.
from tusd.
Related Issues (20)
- Notify*Uploads in Config and handler.*Uploads Are Public and May Conflict With Internal Code HOT 1
- File ID Changes Across Hook Stages HOT 3
- All HookResponse fields are Ignored for Post-Create HOT 4
- S3 headIncompletePartForUpload function error exclusions seem insufficient HOT 6
- Rate limit for webhook requests HOT 3
- s3 ListParts error on final concatenation HOT 17
- Store the Mimetype on storage backends supporting it HOT 3
- Close unfinished file HOT 2
- Allow using '/' when setting ChangeFileInfo.ID to enable "hierarchival" views in Azure Blob Storage HOT 3
- How to specify a path based on the information in MetaData HOT 2
- Logging: how to reduce level from debug to info? HOT 1
- v2.1.0 cpu 100% HOT 6
- Dynamicly setting S3 Bucket HOT 1
- Disallow non-URL-safe character in `changeFileInfo.ID`
- High memory usage when uploading to Azure Storage HOT 12
- Deferred upload length can bypass upload size limit
- Getting lots of errors while using tusd with s3 store HOT 12
- UPLOAD create the file in Blob storage but Patch fails with Wrong url HOT 1
- crash with http2 HOT 11
- multiple post-receive invocations if doing more than one parallel uploads: built-in mechanism to get the "overall" offset? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tusd.