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

weldr / bdcs-api / 122
70%

Build:
DEFAULT BRANCH: master
Ran 23 Apr 2018 07:47PM UTC
Jobs 1
Files 21
Run time 761min
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
122

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

Jobs
ID Job ID Ran Files Coverage
1 122.1 24 Apr 2018 08:28AM UTC 0
73.33
Travis Job 122.1
Source Files on build 122
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #122
  • 52315df7 on github
  • Prev Build on master (#115)
  • Next Build on master (#121)
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

© 2025 Coveralls, Inc