apache / apache/trafficserver

Different the cache behavious in CacheVC::openWriteMain

Open
#5,503 3 comments 0 reactions 1 assignee Claimed by @SolidWallOfCode View on GitHub
Cache
Dominant language
C++
Stars
2k
Forks
874
Avg merge
6d 15h
Merged PRs (30d)
46

Description

There are two different `reenable` between test and ats.

For test, we automatically fill buffer and `CacheVC::openWriteMain` will consume data directly without returning back to event system.

https://github.com/apache/trafficserver/blob/c934b15aa817088bf18d724e01ba2bec3308f9cf/iocore/cache/CacheWrite.cc#L1423-L1431

see it will goto `Lagian`(line 1430) to consume more data. Once the `total_len` hits the limit. `it will write it down, even if it is a single fragment . That means even if it is a single fragment. we still have 2 fragment in cache for a single fragment`. These should be fixed in another pr.

For ats. `HttpTunnel` will reenable producer to produce more data and then reenable consumer. That will return back to event system between the two reenable. So the `goto Lagain` will consume nothing and finally callback with `VC_EVENT_WRITE_COMPLETE` (line 1388).

https://github.com/apache/trafficserver/blob/c934b15aa817088bf18d724e01ba2bec3308f9cf/iocore/cache/CacheWrite.cc#L1386-L1395

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.