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

caicloud / nirvana / 549 / 2
46%
master: 46%

Build:
DEFAULT BRANCH: master
Ran 09 Mar 2018 03:58AM UTC
Files 60
Run time 2s
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

09 Mar 2018 03:53AM UTC coverage: 60.75% (-0.2%) from 60.907%
549.2

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%)

26.51 hits per line

Source Files on job 549.2
  • Tree
  • List 0
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1
  • Travis Job 549.2
  • 7a2e32b2 on github
  • Prev Job for on master (#548.2)
  • Next Job for on master (#559.2)
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