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

Странные торренты в поиске #52

Closed
CoderFF opened this issue Jul 23, 2018 · 6 comments
Closed

Странные торренты в поиске #52

CoderFF opened this issue Jul 23, 2018 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@CoderFF
Copy link

CoderFF commented Jul 23, 2018

По запросу "приключений"

2018-07-23 17-09-36

Выводит странные торренты

NaN undefined (undefined files)
Планета приключений/1-2. Планета приключений (пер. Тишинин).fb2
Планета приключений/1-4. Планета приключений.fb2

NaN undefined (undefined files)
Берндорф Ганс, Букар Робер - (В мире приключений) Сети шпионажа [Сборник].fb2

NaN undefined (undefined files)
2002 - Форева/09 - Жажда приключений.mp3
2004 - Живой и невридимый/12 - Жажда Приключений.mp3
2002 - Форева/09 - Жажда приключений.mp3

magnet ссылка у всех magnet:?xt=urn:btih:undefined

При попытке кликнуть на такой торрент, приложение крэшится
Вот что в логах

/home/coder/workspace/rats-search/src/background/api.js:128
		if(hash.length != 40)
		        ^

TypeError: Cannot read property 'length' of null
    at onTorrent (/home/coder/workspace/rats-search/src/background/api.js:128:11)
    at Socket.args (/home/coder/workspace/rats-search/src/background/api.js:76:9)
    at emitThree (events.js:136:13)
    at Socket.emit (events.js:217:7)
    at /home/coder/workspace/rats-search/node_modules/socket.io/lib/socket.js:527:12
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Из базы данных вот что выяснил:

mysql> select * from files where MATCH('приключений') limit 1;
+---------+---------+---------------------------------------------------------------------------------------------------------------+------------------------------------------+
| id      | size    | path                                                                                                          | hash                                     |
+---------+---------+---------------------------------------------------------------------------------------------------------------+------------------------------------------+
| 2414876 | 1409369 | Планета приключений/1-2. Планета приключений (пер. Тишинин).fb2                                               | 12c0cfd6e2bad8ba116c883d48ca0ca5f0bf3f14 |
+---------+---------+---------------------------------------------------------------------------------------------------------------+------------------------------------------+
1 row in set (0,02 sec)

mysql> select * from torrents where hash='12c0cfd6e2bad8ba116c883d48ca0ca5f0bf3f14' limit 1;
Empty set (0,02 sec)

Я так понимаю, что после выполнения операции "CLEAN TORRENTS" сложилась такая ситуация, что торрент удалён, а файлы от него - нет.

@DEgITx
Copy link
Owner

DEgITx commented Jul 23, 2018

случайно не выходил из приложения в момент очистки? или как-то прерывал процесс?

@DEgITx DEgITx self-assigned this Jul 23, 2018
@DEgITx DEgITx added the bug Something isn't working label Jul 23, 2018
@DEgITx
Copy link
Owner

DEgITx commented Jul 23, 2018

В общем там из-за прерывания очистки такое в целом могло произойти, в следующей версии уже поправлю, заодно более активный индикатор прицеплю, а то совершенно не видно как оно чистит

@CoderFF
Copy link
Author

CoderFF commented Jul 23, 2018

Уверен, что не выходил.
Он выстветил цифру, сколько удалил торрентов + еще долго после этого работал, я так понимаю он продолжает удалять в фоновом режиме. Нарузка на проц от searchd была на 100% еще долго (хотя может быть, активный обмен торрентами).

Что хочу добавить, это догадка, может быть мимо абсолютно. При старте приложения довольно долго выполняется вот такое действие:

sphinx: binlog: replaying log /home/coder/workspace/rats-search/binlog.001

sphinx: binlog: index torrents: recovered from tid 427467 to tid 488878
binlog: index files: skipped at tid 7828127 and max binlog tid 6437868
binlog: replay stats: 818766 rows in 819391 commits; 34219 updates, 0 reconfigure; 2 indexes

sphinx: binlog: finished replaying /home/coder/workspace/rats-search/binlog.001; 240.9 MB in 2.476 sec
binlog: replaying log /home/coder/workspace/rats-search/binlog.002

sphinx: binlog: index torrents: recovered from tid 488878 to tid 500536
binlog: index files: skipped at tid 7828127 and max binlog tid 6557804
binlog: replay stats: 124213 rows in 124264 commits; 7330 updates, 0 reconfigure; 2 indexes
binlog: finished replaying /home/coder/workspace/rats-search/binlog.002; 35.2 MB in 0.385 sec
binlog: replaying log /home/coder/workspace/rats-search/binlog.003
 

Что по этому поводу пишут в документации от searchd:

Binary logs are essentially a recovery mechanism. With binary logs enabled, searchd writes every given transaction to the binlog file, and uses that for recovery after an unclean shutdown. On clean shutdown, RAM chunks are saved to disk, and then all the binlog files are unlinked.

То есть, при нормальном завершении работы searchd, этих бинлогов вообще быть не должно, а у меня они постоянно! Выходит, какое-то повреждение БД возможно.

В таком случае возникает вопрос, каким образом можно завершить работу серверного rats-search так, чтобы и searchd завершил работу нормально? Я запускаю так

nvm exec lts/carbon npm run server

Завершаю - Ctrl+C

@DEgITx
Copy link
Owner

DEgITx commented Jul 23, 2018

У серверной версии в отличии от десктопной нет нормальной обработки выхода, ctrl+с в любом случае резко прерывает работу скрипта, ни о каком корректном завершении там говорить не приходится, запиши насчет этого в отдельный тикет, я хотел с этим разобраться, но подзабыл... насчет этой же проблемы - это не из-за этого, я там сделаю комит на днях, который с этой проблемой должен разобраться

DEgITx added a commit that referenced this issue Jul 24, 2018
@DEgITx
Copy link
Owner

DEgITx commented Jul 24, 2018

в 7e0c565 поправлен сам механизм очистки) (возможно поправлен)
но это не касается тех торрентов которые уже хреново чистануло

@DEgITx
Copy link
Owner

DEgITx commented Jul 25, 2018

должно сейчас корректно в серверной версии выходить по ctrl+c

DEgITx pushed a commit that referenced this issue Aug 6, 2018
# [0.27.0](v0.26.2...v0.27.0) (2018-08-06)

### Bug Fixes

* **background:** one closing pattern ([63158dc](63158dc))
* **closing:** window can be closing on event ([84e9573](84e9573))
* **gui:** top tabs text overlap ([45168a2](45168a2))
* **linux:** fix closing on linux ([75ad00a](75ad00a))
* **linux:** fix console control after exit ([29cd05a](29cd05a))
* **macos:** fix crashes under Mac OS X ([015447c](015447c))
* **macos:** stabilization with connection pool ([769521f](769521f))
* **scanner:** fix enconding names in some cases [#55](#55) ([f1043eb](f1043eb))
* **server:** fix exit on server version [#54](#54) [#52](#52) ([4109ef9](4109ef9))
* **translations:** hash translation ([f5a6f17](f5a6f17))

### Features

* **cleaning:** fix cleaning checking and removing torrents (also display cleaning status in more details) [#52](#52) ([7e0c565](7e0c565))
* **closing:** fast window closing/hiding ([019700e](019700e))
* **search:** add remote torrents in db via dht and search requests ([1e44164](1e44164))
* **search:** hash/magnet search support in db ([1e57789](1e57789))
* **torrents:** add support for dropping torrent to base just with window ([6d82291](6d82291))

### Performance Improvements

* **replication:** replication thread optimization ([c5427a6](c5427a6))
@DEgITx DEgITx closed this as completed Aug 19, 2018
DEgITx added a commit that referenced this issue Jun 1, 2023
DEgITx pushed a commit that referenced this issue Jun 1, 2023
# [0.27.0](v0.26.2...v0.27.0) (2018-08-06)

### Bug Fixes

* **background:** one closing pattern ([63158dc](63158dc))
* **closing:** window can be closing on event ([84e9573](84e9573))
* **gui:** top tabs text overlap ([45168a2](45168a2))
* **linux:** fix closing on linux ([75ad00a](75ad00a))
* **linux:** fix console control after exit ([29cd05a](29cd05a))
* **macos:** fix crashes under Mac OS X ([015447c](015447c))
* **macos:** stabilization with connection pool ([769521f](769521f))
* **scanner:** fix enconding names in some cases [#55](#55) ([f1043eb](f1043eb))
* **server:** fix exit on server version [#54](#54) [#52](#52) ([4109ef9](4109ef9))
* **translations:** hash translation ([f5a6f17](f5a6f17))

### Features

* **cleaning:** fix cleaning checking and removing torrents (also display cleaning status in more details) [#52](#52) ([7e0c565](7e0c565))
* **closing:** fast window closing/hiding ([019700e](019700e))
* **search:** add remote torrents in db via dht and search requests ([1e44164](1e44164))
* **search:** hash/magnet search support in db ([1e57789](1e57789))
* **torrents:** add support for dropping torrent to base just with window ([6d82291](6d82291))

### Performance Improvements

* **replication:** replication thread optimization ([c5427a6](c5427a6))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants