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

From Discord: Katana as an SDK issue #714

Open
MetzinAround opened this issue Jan 4, 2024 · 1 comment
Open

From Discord: Katana as an SDK issue #714

MetzinAround opened this issue Jan 4, 2024 · 1 comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@MetzinAround
Copy link

katana version: 2

Current Behavior:

When I tried to use Katana as an SDK, I encountered an issue. I added Katana as a package and ran it, but it didn't work. I tried go version go1.21.5 linux/amd64, and it seems Katana isn't stable in this version. Later, I investigated and found the problematic code block in Katana.
The problematic part was the Do function inside pkg/engine/common/base.go. In the Do function, the for loop at the top was for item := range crawlSession.Queue.Pop(), but it wasn't affected by the code at line 244 that I'm showing below
katana issue 1

The go func(){} structure runs asynchronously, causing the for loop to complete without waiting for a new variable assignment to the queue, which was why Katana wasn't functioning.
I resolved the issue by modifying the relevant code block as follows. Keep this in mind if you encounter a similar problem. 😅
katana 2

@MetzinAround MetzinAround added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jan 4, 2024
@Mzack9999 Mzack9999 reopened this Mar 19, 2024
@Mzack9999 Mzack9999 linked a pull request Mar 19, 2024 that will close this issue
@dogancanbakir
Copy link
Member

          @Serhatcck I think the issue could have been a too short timeout for the specific target, since go routine is anyway awaited via the `wg.Wait()` at the end. Have you tried with a larger `-timeout` (default is 10s)

Originally posted by @Mzack9999 in #717 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants