Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log requests from the CLI #109

Open
schomatis opened this issue May 7, 2018 · 3 comments
Open

Log requests from the CLI #109

schomatis opened this issue May 7, 2018 · 3 comments

Comments

@schomatis
Copy link
Contributor

Currently requests are only being logged in the online mode by the HTTP handler. It would be useful to extend this mechanism to cover any IPFS use case, which means logging it also in the offline mode in the CLI.

Normally this wouldn't be necessary as the request log is only used as an informative service where there can be more than one request simultaneously (i.e., in the online mode handling many concurrent HTTP request and not in the offline mode with the CLI handling an only request before shutting down) but the rationale is to have a single point of control for any requests (one or many) before shutting down the IPFS core.

@schomatis schomatis added the status/blocked Unable to be worked further until needs are met label May 8, 2018
@schomatis
Copy link
Contributor Author

I'm having some trouble with the gx workflow (see whyrusleeping/gx#174) so I'm labeling this as blocked until I gain a better understanding of it.

@keks
Copy link
Contributor

keks commented May 14, 2018

@schomatis Sorry for only responding now.

I'm not sure, but there may be a misunderstanding here. IPFS can call it's commands either directly from the cli, or send it to the daemon via http. Note that this has nothing to do with online or offline mode. Online/Offline mode is a property of your running daemon, and specifies whether or not your ipfs node talks to other ipfs nodes. A daemon in offline mode will still track your requests, since they come in through the http api. When a requests is executed directly through the cli, tracking the requests doesn't make much sense because there is just that one requests that is handled by the process.

Also note that IIUC the request log is only kept in memory, and only as long as the daemon is running. Since in the cli case (i.e. when there is no daemon) there is no process in the background that could track requests, all of this would need to be restructured.

@schomatis schomatis changed the title Log request in offline mode Log requests from the CLI May 14, 2018
@schomatis
Copy link
Contributor Author

@keks Thanks for the clarification in the terminology.

When a requests is executed directly through the cli, tracking the requests doesn't make much sense because there is just that one requests that is handled by the process.

Yes but @whyrusleeping suggested using the request log as an indication of command termination (even if it is the only one) to avoid shutting down the node prematurely and wait for the command.

Since in the cli case (i.e. when there is no daemon) there is no process in the background that could track requests, all of this would need to be restructured.

This is a good point, I'll have to look deeper into the code. The log request is still created in the CLI case but I haven't found an easy way to check if a request logged in the CLI executor is actually being logged, since the ipfs diag cmds command can only run on the IPFS daemon.

@schomatis schomatis removed the status/blocked Unable to be worked further until needs are met label May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants