• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

caicloud / nirvana / 549
46%

Build:
DEFAULT BRANCH: master
Ran 09 Mar 2018 03:58AM UTC
Jobs 2
Files 60
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
549

push

travis-ci

caicloud-bot
fix(service): remove cache pool for http context (#184)

Automatic merge from submit-queue.

fix(service): remove cache pool for http context

**What this PR does / why we need it**:

We have a cache pool for HTTP context before. It creates new context when a request coming and recycles it after the request done. But if someone use this context after it being recycled, it may panic. 
There are two ways we have considered:
1. Add a safe layer for the context
  - Flexible
  - Still has a problem about retained HTTPContext.
    ```go
    func handler(ctx context.Context) {
        // The retained httpCtx may go in wrong after the context being recycled.
        httpCtx := service.HTTPContextFrom(ctx)
    }
    ```
1. Remove cache pool
  - Simple
  - Has minimal performance loss (about 1%).

So we choose the second solution. 

**Special notes for your reviewer**:

/cc @ddysher 
/cc @caitong93 
/cc @walktall 
/cc @zoumo 
/cc @Jimexist 

**Release note**:


```release-note
Remove cache pool for http context
```

<!--  Thanks for sending a pull request! Here are some tips:

1. https://github.com/caicloud/engineering/blob/master/docs/review_conventions.md  <-- what is the review process looks like
2. https://github.com/caicloud/engineering/blob/master/docs/commit_conventions.md  <-- how to structure your git commit
3. https://github.com/caicloud/engineering/blob/master/docs/caicloud_bot.md        <-- how to work with caicloud bot

Other tips from Kubernetes cmomunity:

1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/devel/pull-requests.md#the-pr-submit-process and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/devel/pull-requests.md#best-practices-for-faster-reviews
3. Follow the instructions for writing a release note: http... (continued)

2882 of 4744 relevant lines covered (60.75%)

53.01 hits per line

Jobs
ID Job ID Ran Files Coverage
1 549.1 09 Mar 2018 03:59AM UTC 0
60.75
Travis Job 549.1
2 549.2 09 Mar 2018 03:58AM UTC 0
60.75
Travis Job 549.2
Source Files on build 549
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #549
  • 7a2e32b2 on github
  • Prev Build on master (#548)
  • Next Build on master (#559)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc