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

Concurrency problem in file-load and tags command #10

Open
YUKINA-3252 opened this issue Sep 7, 2022 · 2 comments
Open

Concurrency problem in file-load and tags command #10

YUKINA-3252 opened this issue Sep 7, 2022 · 2 comments
Assignees

Comments

@YUKINA-3252
Copy link

Describe the bug

[DEBUG - bridge:L226] Socket Response: (:emacs-rex (swank:load-file "paper-folding-right.l") "USER" :repl-thread 5)

[DEBUG - server:L94] raw data: 00004d (:emacs-rex (swank:load-file "paper-folding-right.l") "USER" :repl-thread 5)

[DEBUG - protocol:L69] Processing id: 5 ...
[INFO - protocol:L71] func: swank_load_file
[INFO - protocol:L72] args: [u'paper-folding-right.l']
[DEBUG - handler:L548] Acquiring lock: <thread.lock object at 0x7fed87d5c590>
[DEBUG - server:L40] response: [Symbol(':write-string'), u'Loading file: paper-folding-right.l ...\n']
[INFO - bridge:L358] eval: (slime::load-file-and-tags "paper-folding-right.l")
[DEBUG - bridge:L226] Socket Response: 000057
[DEBUG - bridge:L226] Socket Response: (:emacs-rex (swank:find-tag-name-for-emacs "reset-pose" "USER") "USER" :repl-thread 6)

[DEBUG - server:L94] raw data: 000057 (:emacs-rex (swank:find-tag-name-for-emacs "reset-pose" "USER") "USER" :repl-thread 6)

[DEBUG - protocol:L69] Processing id: 6 ...
[INFO - protocol:L71] func: swank_find_tag_name_for_emacs
[INFO - protocol:L72] args: [u'reset-pose', u'USER']
[INFO - bridge:L332] exec_internal: (slime::find-tag-name-for-emacs "reset-pose" "USER")
[DEBUG - bridge:L334] Acquiring lock: <thread.lock object at 0x7fed87d5c5b0>
[DEBUG - bridge:L226] Socket Response: #i(48 
[ERROR - protocol:L89] Traceback (most recent call last):
  File "/home/baxter/ros/melodic/src/euslime/src/euslime/protocol.py", line 81, in process
    for resp in gen:
  File "/home/baxter/ros/melodic/src/euslime/src/euslime/handler.py", line 607, in swank_find_tag_name_for_emacs
    yield EuslispResult(self.euslisp.exec_internal(cmd))
  File "/home/baxter/ros/melodic/src/euslime/src/euslime/bridge.py", line 340, in exec_internal
    res = gen_to_string(gen)
  File "/home/baxter/ros/melodic/src/euslime/src/euslime/bridge.py", line 36, in gen_to_string
    return ''.join([x for x in list(gen) if isinstance(x, str)])
  File "/home/baxter/ros/melodic/src/euslime/src/euslime/bridge.py", line 287, in get_socket_result
    gen = self.get_socket_response(connection)
  File "/home/baxter/ros/melodic/src/euslime/src/euslime/bridge.py", line 255, in get_socket_response
    command, data = self.recv_socket_data(connection)
  File "/home/baxter/ros/melodic/src/euslime/src/euslime/bridge.py", line 246, in recv_socket_data
    command = self.recv_socket_next(connection, wait=wait)
  File "/home/baxter/ros/melodic/src/euslime/src/euslime/bridge.py", line 236, in recv_socket_next
    hex_len = int(head_data, 16)
ValueError: invalid literal for int() with base 16: '#i(48 '
@YUKINA-3252
Copy link
Author

(:emacs-rex
 (swank:load-file "paper-folding-right.l")
 "USER" :repl-thread 5)
(:write-string "Loading file: paper-folding-right.l ...\n")
(:emacs-rex
 (swank:find-tag-name-for-emacs "reset-pose" "USER")
 "USER" :repl-thread 6)
(:debug 0 1
        ("ValueError: invalid literal for int() with base 16: '#i(48 '" "" nil)
        (("QUIT" "Quit to the SLIME top level")
         ("CONTINUE" "Ignore the error and continue in the same stack level")
         ("RESTART" "Restart euslisp process"))
        nil
        (nil))

Affonso-Gui added a commit to Affonso-Gui/euslime that referenced this issue Sep 7, 2022
Affonso-Gui added a commit to Affonso-Gui/euslime that referenced this issue Sep 7, 2022
@Affonso-Gui
Copy link
Member

For now I am taking a safe approach to this and blocking all (both repl and internal) operations while loading files.
1835664

This means that tag jumps, completion functions, documentation reference, and other requests will be postponed while loading files.

This should solve the error, but is obviously not the best solution unless we are sure that the eus subprocess is unable to reliably handle concurrent operations while loading.
Therefore I am leaving this open for eventually revisiting it.

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