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

weldr / bdcs-api / 122 / 1
70%
master: 70%

Build:
DEFAULT BRANCH: master
Ran 24 Apr 2018 08:28AM UTC
Files 21
Run time 3s
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

23 Apr 2018 07:13PM UTC coverage: 73.327% (+0.9%) from 72.474%
122.1

push

travis-ci

clumens
Fix CPU usage and other concurrency problems.

This is a hard commit to break up into smaller chunks.  It basically
rewrites the concurrency portion of Server.hs, which ends up touching a
few other places.  Here's the main parts:

(1) Get rid of the separate cfgWorkQ channel that holds composes waiting
to be started.  Instead, I've introduced a new ComposeMsgAsk type that
the API server can use to request a compose be started, just like it
uses other message types to ask other things.

(2) This means the slot in AskTuple used for the compose server to write
an answer back now becomes a Maybe.  If a compose is requested, there is
no answer.  The client requests the status later on.

(3) Use the concurrency functions in the async module.  These are a
little nicer to use and there's all sorts of more advanced functions we
may be able to make use of later, if needed.

(4) composeServer does two tasks - listen and respond to messages, and
start composes.  I was previously doing this pretty stupidly.  In a
single loop, I would deal with any messages and then look for any
composes to start.  This is now done in two separate, eternally running
threads.

(5) There is actually still a worklist that does the same function as
cfgWorkQ used to do, but it is no longer exposed.  It's only used by
composeServer and its two helper threads.

(6) Stop using an IORef to manage the worklist.  Polling on this value
in a loop was keeping the CPU pegged at 100% at all times.  Instead, use
a list in a TVar and use some custom code to treat it like a queue.  It
shouldn't ever get large, so this should be fine.  Note the very
important comment above the retry call.

1578 of 2152 relevant lines covered (73.33%)

1.39 hits per line

Source Files on job 122.1
  • Tree
  • List 0
  • Changed 7
  • Source Changed 7
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 35
  • Travis Job 122.1
  • 52315df7 on github
  • Prev Job for on master (#115.1)
  • Next Job for on master (#121.1)
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