The lightning talks are the first round of lightning talks from many speakers.
Note: This post was live-blogged at dotGo 2017. Let us know on Twitter (@sourcegraph) if we missed anything. All content is from the talk; any mistakes or misrepresentations are our fault, not the speaker's.
Reducing Go programs
Daniel Marti
Reducing go program means to simplify code without changing what it does.
gosmith works with syntax trees, not
bytes. So is much more effective at finding bugs in Go compiler.
It has found 50+ compiler bugs, 3+ spec changes
However, it produces hard to understand output. An example is shown which a
go program takes up a whole slide gets reduced to a few lines which still
reproduces a compiler bug.
gosmith is based on prior art:
csmith which fuzzes c compilers.
To solve hard to understand cases, the csmith-project also has
creduce which
simplifies/reduces c programs while still reproducing the c compiler bug.
Some issues in Go toolchain is that Daniel had to write out the bytes and
invoke the full compiler toolchain to see if the bug still reproduced. This
means 100ms to make change, which is slow to automatically reduce.
See mvdan.cc/goreduce to find out more and try out the tool.
Handling slow requests in your Go web server
Jaime Silvela
A common problem in HTTP servers is doing slow jobs. For example processing
that takes minutes.
To do this naively your users will run into issues like 504 gateway
time-out.
Usually what people do is introduce a Job Queue.
Problem is this is a new bit of infrastructure to manage.
Another problem is serialization and deserialization can be significant for
large upload payloads.
Solution 1 is queue with channels + worker pattern.
Identify jobs with ticket number, track progress in DB
goroutine listening, running and publishing results
Problems when you can get too much work to do
Solutions: time limit, channel buffered, more worker goroutines
Solution 2 Just start goroutine
Shutdown is a problem due to potentially losing work, can use waitgroup.
Solution is simple and works well.
Conclusion: You can handle slow requests entirely in your go server.
Licenses
Fabio Rapposelli
You are coding a lot and run go get a lot to get great packages to solve
your problems.
You are about to launch your product but then have to do legal review.
The lawyers start vetting dependency packages with bad license.
The issue here is license creep, you introduce a dependency without
realising you can't use it due to the license.
Fabio created a tool called: WWHRD - What would Henry Rollins Do. \m/