Comments (4)
Yep I confirmed the fix, switching from StdoutPipe and StderrPipe to a custom os.Pipe() solved the output issues when in google cloud run.
I had to change the pipes in func getUsername
, func (a *API) startPipes()
and func (a *API) Listen
and it worked out great.
Fix in my fork:
https://github.com/malware-unicorn/go-keybase-chat-bot/blob/master/kbchat/kbchat.go#L37
Also os.Pipe does not work in Windows environments so there might need to be a better work around in the future.
from go-keybase-chat-bot.
@malware-unicorn calling Run
on the command blocks until completion, defeating the timeout in play later in the function https://github.com/malware-unicorn/go-keybase-chat-bot/blob/master/kbchat/kbchat.go#L48. In #57 I added the output pipe to ExtraFiles
, are you able to get the command running with these fixes?
from go-keybase-chat-bot.
@joshblum yeah the Run
is not needed but what is needed is the actual assignment for stdout because the command needs a different file descriptor since the container's stdout file descriptor is being locked/used by google cloud run's logging.
pipeR, pipeW, _ := os.Pipe()
p.Stdout = pipeW <-------This is needed
p.ExtraFiles = []*os.File{
pipeW,
}
and
scanner := bufio.NewScanner(pipeR)
Anywhere StdoutPipe
is called would need to be changed to p.Stdout = pipeW
from go-keybase-chat-bot.
@malware-unicorn calling StdoutPipe
creates a pipe, it doesn't use os.Stdout
so our changes should be equivalent with the ExtraFiles
call https://golang.org/src/os/exec/exec.go?s=17635:17684#L604
from go-keybase-chat-bot.
Related Issues (10)
- Proposal: Parity between bot functions and Keybase API names
- Proposal: rename bot package
- Use GoDoc
- Keybase HOT 1
- CombinedOutput causes unmarshal error
- Memory leak when `keybase status` times out HOT 6
- Add support for sending exploding messages HOT 1
- Is the `keybase app` path and `KBFS path` the same thing? HOT 3
- New builds with keybase/client update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-keybase-chat-bot.