Projects tigase _server tigase-http-api Issues #146
Current version of http-api floods the logs with "sendResponseHeaders: rCode = 304: forcing contentLen = -1" (#146)
Closed
wojciech.kapcia@tigase.net opened 4 months ago
xmpp-1  | [2024-05-13 17:13:57:514] [WARNING ] [    http-server-pool-3 ] ExchangeImpl.sendResponseHeaders(): sendResponseHeaders: rCode = 304: forcing contentLen = -1
xmpp-1  | [2024-05-13 17:13:57:521] [WARNING ] [    http-server-pool-3 ] ExchangeImpl.sendResponseHeaders(): sendResponseHeaders: rCode = 304: forcing contentLen = -1
xmpp-1  | [2024-05-13 17:13:57:524] [WARNING ] [    http-server-pool-1 ] ExchangeImpl.sendResponseHeaders(): sendResponseHeaders: rCode = 304: forcing contentLen = -1
xmpp-1  | [2024-05-13 17:13:57:526] [WARNING ] [    http-server-pool-2 ] ExchangeImpl.sendResponseHeaders(): sendResponseHeaders: rCode = 304: forcing contentLen = -1
xmpp-1  | [2024-05-13 17:13:57:533] [WARNING ] [    http-server-pool-4 ] ExchangeImpl.sendResponseHeaders(): sendResponseHeaders: rCode = 304: forcing contentLen = -1
Andrzej Wójcik (Tigase) commented 4 months ago

Do you have any idea what requests are causing this issue?

I've found following code in the source code of ExchangeImpl:

        if ((rCode>=100 && rCode <200) /* informational */
            ||(rCode == 204)           /* no content */
            ||(rCode == 304))          /* not modified */
        {
            if (contentLen != -1) {
                String msg = "sendResponseHeaders: rCode = "+ rCode
                    + ": forcing contentLen = -1";
                logger.log (Level.WARNING, msg);
            }
            contentLen = -1;
            noContentLengthHeader = (rCode != 304);
        }

That would suggest that something is sending 304 and is setting content or passing length of not -1.

Possibly, we could modify https://github.com/tigase/tigase-http-api/blob/a80837c747099682070426756cf8c8eef48c9d1e/src/main/java/tigase/http/java/DummyServletResponse.java#L307 to log stacktrace for calls causing this issue.

Note: I've not observed any entries like that during normal usage of a new version, so I wonder if that is not caused by some external services sending HEAD requests.

wojciech.kapcia@tigase.net commented 4 months ago

Do you have any idea what requests are causing this issue?

It happens on virtually all navigation (/admin, /dashboard, /). Each click/brows one generates at least 3-4 entries (probably number of requests).

Though I just tried and it stopped happening... and it was happening constantly...

wojciech.kapcia@tigase.net batch edited 4 months ago
Name Previous Value Current Value
Iterations
empty
tigase-server-8.4.0
wojciech.kapcia@tigase.net batch edited 3 months ago
Name Previous Value Current Value
Iterations
tigase-server-8.4.0
tigase-server-8.5.0
Version
tigase-server-8.4.0
tigase-server-8.5.0
Referenced from commit 3 months ago
Andrzej Wójcik (Tigase) changed state to 'In Progress' 3 months ago
Previous Value Current Value
Open
In Progress
Andrzej Wójcik (Tigase) changed state to 'In QA' 3 months ago
Previous Value Current Value
In Progress
In QA
Referenced from commit 3 months ago
Andrzej Wójcik (Tigase) commented 3 months ago

I've found cause of this issue (checking if assets/css/js files were modified) and I've applied a fix for this issue.

wojciech.kapcia@tigase.net changed state to 'Closed' 3 months ago
Previous Value Current Value
In QA
Closed
issue 1 of 1
Type
Improvement
Priority
Minor
Assignee
Version
tigase-server-8.5.0
Target Release
1.0
Sprints
n/a
Customer
n/a
Iterations
Issue Votes (0)
Watchers (3)
Reference
tigase/_server/tigase-http-api#146
Please wait...
Page is in error, reload to recover