Comments (11)
Would it be possible to keep panics and catch them by deferring a call to function recover
?
I searched through the code, there are os.Exit invocations in vendor packages and 4 within Derek
from derek.
It would be possible, but I think we could change the code as part of this instead. Can you link to the instances (with line number) please?
from derek.
These are the calls to os.Exit within Derek
, there are more from vendor packages :
https://github.com/alexellis/derek/blob/master/main.go#L34
https://github.com/alexellis/derek/blob/master/main.go#L40
https://github.com/alexellis/derek/blob/master/main.go#L47
https://github.com/alexellis/derek/blob/master/main.go#L55
from derek.
Thanks for the research.
Do you want to try doing this issue first? #97
For the line numbers you can click the line on GitHub's UI and then copy/paste the URL.
from derek.
Sure, I updated my previous comment with links to the corresponding line.
from derek.
@cheikhshift are you still working on this? 😄
from derek.
from derek.
Can you propose a PR?
Alex
from derek.
from derek.
I reviewed the issue, this is what I'm going to work on :
- isolate most of the main.go file (in package root) in a new sub package called handler.
- Modify the current OpenFaaS deployment file to use the Go template.
- We need to keep invocations to panic, as they can modify response code provided by OpenFaaS. Some dependencies make invocations to os.Exit, but as long as
derek
is not using any deprecated functions, things should be fine.
PR to follow soon.
Since I've mentioned HTTP responses, OpenFaas should have a helper package, to provide a sort of translation of how OpenFaaS interfaces with HTTP requests. This may reduce friction for users coming from a RESTful API background.
from derek.
Thanks for your take on the changes. We have a REST-compatible template called golang-http and golang-middleware both are available via faas-cli template store list
and would have the benefit of keeping Derek's process alive between requests.
from derek.
Related Issues (20)
- Pull Derek's watchdog binary via multi-stage build HOT 1
- Run Derek container as non-root user HOT 4
- Publishing Docker images is broken HOT 4
- Have Derek add commits as well as PRs closed in each release note HOT 1
- Add 1 min safety window for commit listing HOT 2
- Derek marks PR with `no-dco` but the commit is signed HOT 1
- Proposal: Label and message for PRs with Merge Commits HOT 2
- Add Derek to two new organizations (vielmetti, tinkerbell) HOT 3
- Feature request: give multiple commands within a single comment HOT 2
- [Bug] Regression in authentication code HOT 4
- Inconsistent fetching of commits HOT 4
- Switch to using go modules HOT 3
- Proposal: Detect Hacktoberfest PRs without requiring commit sign-off HOT 7
- Suggestion: make this project more visible HOT 3
- Crash generating release notes HOT 1
- Detect repository default branch HOT 4
- Migrate to GitHub Actions HOT 3
- Have Derek show a link for changes between releases on auto-generated release notes. HOT 3
- Validate HMAC with SHA256
- Exclude pre-releases from release notes HOT 4
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 derek.