Coder Social home page Coder Social logo

Comments (9)

nicolasazrak avatar nicolasazrak commented on May 24, 2024 1

I seems that it's not related to the configuration. For compiling it with a more verbose output it's a little bit harder. The problem is that this message comes from the go stdlib, otherwise I would be really easy to change it to show the stacktrace. Let me investigate a little bit, it seems the logger can be changed and that might help.

from caddy-cache.

nicolasazrak avatar nicolasazrak commented on May 24, 2024

I have two guesses here: the first one is that there is a concurrency issue in the cache code and the other one is that there is another plugin that is conflicting with the cache code. Are you using another plugin aside from the proxy one? It would be really useful if you had the cache status of the response that caused the problem or a stacktrace.

The problem is that caddy works as a chain of middlewares and anyone can keep a reference to the ResponseWriter and change the status. The cache already checks that to avoid having this problem (https://github.com/nicolasazrak/caddy-cache/blob/master/response.go#L62) but maybe a previous caller in the middleware chain is trying to add another header. I tried to reproduce the issue without luck, that's why I suspect there is something else.

from caddy-cache.

DeanMarkTaylor avatar DeanMarkTaylor commented on May 24, 2024

As indicated in the forum post the only other "setting" in use is "proxy".
And for reference the only other plugin compiled in (but not used) is "expires".

If you can give me an indication as to how to compile a more verbose debug output I would give a go...
... currently I compile as follows:

docker run --rm -v $(pwd):/install -e PLUGINS=cache,expires,route53 -e VERSION=0.11.0 abiosoft/caddy:builder

(route53 has been added recently and "multiple response.WriteHeader calls" was seen before adding)


Edit: I'll continue to test other config change impacts - currently testing removal of use of status_header - I'll report back.

from caddy-cache.

DeanMarkTaylor avatar DeanMarkTaylor commented on May 24, 2024

I can confirm that removing status_header header has no impact - the problem still exists.

I.e. a config file in the following form with multiple "host" sections causes the issue.

example.co.uk,
www.example.co.uk {
	cache
	proxy / 185.xxx.xxx.xxx {
		transparent
	}
	tls [email protected]
}

example.org,
www.example.org {
	cache
	proxy / 185.xxx.xxx.xxx {
		transparent
	}
	tls [email protected]
}

http://example.net,
http://www.example.net,
example.com,
www.example.com {
	cache
	proxy / 91.xxx.xxx.xxx {
		transparent
	}
	tls [email protected]
}

I do I use tls { ask ... } in one of the config sections currently - however these offending log entries were seen before this was added.

As mentioned previously it would be great if you could give me an indication as to how to compile a more verbose debug output that would aid you.

from caddy-cache.

DeanMarkTaylor avatar DeanMarkTaylor commented on May 24, 2024

I'm also having a different issue regarding stuck / stalled requests - which may / may not be related:
https://caddy.community/t/requests-not-completing-stuck-possibly-cache-plugin-issue/4779?u=deanmarktaylor

from caddy-cache.

nicolasazrak avatar nicolasazrak commented on May 24, 2024

This is likely to be a race condition. Can you compile it and run it with -race? I'm going to try to debug it using large files using a range header, maybe that path is problematic.

from caddy-cache.

naiba avatar naiba commented on May 24, 2024

I'm also having a different issue regarding stuck / stalled requests - which may / may not be related:
https://caddy.community/t/requests-not-completing-stuck-possibly-cache-plugin-issue/4779?u=deanmarktaylor

@DeanMarkTaylor I also found this problem, the reason is here. The reason why the request is not interrupted is that the channel is blocked here. If you want to experience the plugin after the merge, I can compile one for you.

and why not merge it? @nicolasazrak

from caddy-cache.

nicolasazrak avatar nicolasazrak commented on May 24, 2024

@DeanMarkTaylor Thanks to the fix that @naiba proposed, I've understood why some request got stuck, it's because of slow readers where breaking the pub/sub mechanism. I've just published the fix. I hope it solves the problem.

from caddy-cache.

DeanMarkTaylor avatar DeanMarkTaylor commented on May 24, 2024

I've came back to testing this again, noted another issue - this might be directly related but reported as a separate bug here:
#52

from caddy-cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.